{ "id": "93027", "key": "TIMOB-9477", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2012-06-11T05:00:41.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "qe-ios060112", "reprod" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:07.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Media displays the state as Initialized(0) instead of Stopped(5) when streaming is stopped.\r\nThis is not regression. The issue occurs as far as 1.8.2.\r\n\r\nSteps to reproduce:\r\n\r\n1. Create app with the code below.\r\n2. Launch the app.\r\n3. Start streaming. \r\n4. Stop streaming.\r\n\r\nActual: The state displayed on the screen is initialized(0) when the streaming is stopped. whereas the console displays the state stopped before displaying the state initialized. On Android, this works fine and the state is shown as stopped.\r\n\r\nExpected: The correct state should be displayed on the screen as well as console.\r\n\r\n\r\n{code}\r\n\r\n\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\n\t\tvar debug = Ti.API.debug;\r\n\t\tvar info = Ti.API.info;\r\n\t\t\r\n\t\tTi.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK;\r\n\t\t\r\n\t\tvar url = Titanium.UI.createTextField({\r\n\t\t value: 'http://www.parishiltonjustme.com/downloads/audio/08_Screwed.mp3',\r\n\t\t color: '#336699',\r\n\t\t returnKeyType: Titanium.UI.RETURNKEY_GO,\r\n\t\t keyboardType: Titanium.UI.KEYBOARD_URL,\r\n\t\t hintText: 'url',\r\n\t\t textAlign: 'left',\r\n\t\t clearOnEdit: true,\r\n\t\t height: 35,\r\n\t\t top: 10,\r\n\t\t width: 300,\r\n\t\t borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\r\n\t\t});\r\n\t\t\r\n\t\tvar streamButton = Titanium.UI.createButton({\r\n\t\t title: 'Start Streaming',\r\n\t\t top: 60,\r\n\t\t width: 200,\r\n\t\t height: 40\r\n\t\t});\r\n\t\t\r\n\t\tvar pauseButton = Titanium.UI.createButton({\r\n\t\t title: 'Pause Streaming',\r\n\t\t top: 110,\r\n\t\t width: 200,\r\n\t\t height: 40,\r\n\t\t enabled: false\r\n\t\t});\r\n\t\t\r\n\t\tvar progressLabel = Titanium.UI.createLabel({\r\n\t\t text: 'Time Played: Not Started',\r\n\t\t top: 160,\r\n\t\t left: 10,\r\n\t\t height: 40,\r\n\t\t width: 300,\r\n\t\t color: '#555',\r\n\t\t textAlignment: 'center'\r\n\t\t});\r\n\t\t\r\n\t\tvar stateLabel = Titanium.UI.createLabel({\r\n\t\t text: 'State: Not Started',\r\n\t\t top: 180,\r\n\t\t left: 10,\r\n\t\t width: 300,\r\n\t\t height: 40,\r\n\t\t color: '#555'\r\n\t\t});\r\n\t\t\r\n\t\twin.add(url);\r\n\t\twin.add(streamButton);\r\n\t\twin.add(pauseButton);\r\n\t\twin.add(progressLabel);\r\n\t\twin.add(stateLabel);\r\n\t\t\r\n\t\tvar streamer = Ti.Media.createAudioPlayer();\r\n\t\t\r\n\t\tstreamButton.addEventListener('click', function() {\r\n\t\t if (streamButton.title == 'Stop Stream') {\r\n\t\t progressLabel.text = 'Stopped';\r\n\t\t streamer.stop();\r\n\t\t pauseButton.enabled = false;\r\n\t\t pauseButton.title = 'Pause Streaming';\r\n\t\t streamButton.title = \"Start Streaming\";\r\n\t\t }\r\n\t\t else {\r\n\t\t progressLabel.text = 'Starting ...';\r\n\t\t streamer.url = url.value;\r\n\t\t streamer.start();\r\n\t\t pauseButton.enabled = true;\r\n\t\t pauseButton.title = 'Pause Streaming';\r\n\t\t streamButton.title = \"Stop Stream\";\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\tpauseButton.addEventListener('click', function() {\r\n\t\t streamer.pause();\r\n\t\t if (streamer.paused) {\r\n\t\t pauseButton.title = 'Unpause Streaming';\r\n\t\t }\r\n\t\t else {\r\n\t\t pauseButton.title = 'Pause Streaming';\r\n\t\t }\r\n\t\t});\r\n\t\t\r\n\t\tstreamer.addEventListener('change', function(e) {\r\n\t\t stateLabel.text = 'State: '+e.description +' ('+e.state+')';\r\n\t\t Ti.API.info('disc: ' + e.description);\r\n\t\t Ti.API.info('state: ' + e.state);\r\n\t\t});\r\n\t\t\r\n\t\tstreamer.addEventListener('progress', function(e) {\r\n\t\t progressLabel.text = 'Time Played: ' + Math.round(e.progress) + ' seconds';\r\n\t\t});\r\n\t\t\r\n\t\t// save off current idle timer state\r\n\t\tvar idleTimer = Ti.App.idleTimerDisabled;\r\n\t\t\r\n\t\t// while we're in this window don't let the app shutdown\r\n\t\t// when the screen is idle\r\n\t\tTi.App.idleTimerDisabled = true;\r\n\t\t\r\n\t\twin.addEventListener('close', function() {\r\n\t\t Ti.API.info(\"window was closed, idleTimer reset to = \" + idleTimer);\r\n\t\t \r\n\t\t // restore previous idle state when closed\r\n\t\t Ti.App.idleTimerDisabled = idleTimer;\r\n\t\t});\r\n\r\nwin.open();\r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: Media - Incorrect state is being displayed when media streaming is stopped.", "creator": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK: 1.8.2, 2.1.0.v20120608174150\r\nStudio: 2.1.0.201206081630\r\nOS: 10.7.3\r\nDevices Tested: iPad2(v 5.1), iPhone4s(v 5.1), Samsung Galaxy tab(Android v 3.2)", "comment": { "comments": [ { "id": "199075", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue also occurs for iPhone 3GS(v 5.0.1)", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-19T03:26:19.000+0000", "updated": "2012-06-19T03:26:19.000+0000" }, { "id": "247237", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Issue reproduces \n\nTested with\n\nTitanium Studio, build: 3.0.1.201212181159\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \niOS iPhone Simulator: iOS SDK version: 6.0", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-12T04:53:39.000+0000", "updated": "2013-04-12T04:53:39.000+0000" }, { "id": "422572", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170620103414\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-22T20:20:25.000+0000", "updated": "2017-06-22T20:20:25.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }