{ "id": "84381", "key": "TIMOB-6941", "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": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-02-03T14:29:49.000+0000", "created": "2011-12-30T05:26:08.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "look1", "regression" ], "versions": [ { "id": "12570", "name": "Release 1.7.5", "archived": true, "released": true, "releaseDate": "2011-11-02" }, { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "14406", "type": { "id": "10020", "name": "Depends", "inward": "is dependent of", "outward": "depends on" }, "inwardIssue": { "id": "84382", "key": "TIDOC-183", "fields": { "summary": "APIDoc: Media - document units of measure in all appropriate media events", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-13T22:14:12.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem\r\n\r\nAudioPlayer progress event units of measure not consistent between 1.7.X and 1.8.0.X.\r\n\r\nOn 1.7.5 units are seconds\r\nOn 1.8.0.1 units are milliseconds\r\n\r\nIs this a regression, or intended?\r\n\r\nThe APIDocs at [Titanium.Media.AudioPlayer.progress|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Media.AudioPlayer.progress-property.html] do not explain which units are intended.\r\n\r\nNote: this needs to be tested on iOS to ensure parity.\r\n\r\nh2. Logs\r\n\r\nThe following logs are output when the test case below is run\r\n\r\n{code:lang=none|title=1.8.0.1 / v8}\r\nI/TiAPI ( 5265): EAC LOGGING: Progress: 1121\r\nI/TiAPI ( 5265): EAC LOGGING: Progress: 2113\r\nI/TiAPI ( 5265): EAC LOGGING: Progress: 3104\r\nI/TiAPI ( 5265): EAC LOGGING: Progress: 4122\r\nI/TiAPI ( 5265): EAC LOGGING: Progress: 5113\r\n{code}\r\n\r\n{code:lang=none|title=1.8.0.1 / Rhino}\r\nI/TiAPI ( 5945): EAC LOGGING: Progress: 1043\r\nI/TiAPI ( 5945): EAC LOGGING: Progress: 2061\r\nI/TiAPI ( 5945): EAC LOGGING: Progress: 3052\r\nI/TiAPI ( 5945): EAC LOGGING: Progress: 4044\r\nI/TiAPI ( 5945): EAC LOGGING: Progress: 5035\r\n{code}\r\n\r\n{code:lang=none|title=1.7.5 / Rhino}\r\nI/TiAPI ( 5614): (kroll$1: app://app.js) [1005,12541] EAC LOGGING: Progress: 2.087\r\nI/TiAPI ( 5614): (kroll$1: app://app.js) [998,13539] EAC LOGGING: Progress: 3.078\r\nI/TiAPI ( 5614): (kroll$1: app://app.js) [1009,14548] EAC LOGGING: Progress: 4.07\r\nI/TiAPI ( 5614): (kroll$1: app://app.js) [996,15544] EAC LOGGING: Progress: 5.061\r\nI/TiAPI ( 5614): (kroll$1: app://app.js) [1000,16544] EAC LOGGING: Progress: 6.079\r\n{code}\r\n\r\nh2. Test case\r\n\r\nThis code was adapted from KS [sound_remote.js|https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/sound_remote.js].\r\n\r\n{code:lang=javascript}\r\nvar audiofile = 'HTTP://www.host.com/path/to/file.mp3'; // see restricted comments for example\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white',\r\n fullscreen: false,\r\n layout:'vertical'\r\n});\r\n\r\nwin.open();\r\n\r\nvar url = Titanium.UI.createTextField({\r\n value:audiofile,\r\n color:'#336699',\r\n returnKeyType:Titanium.UI.RETURNKEY_GO,\r\n keyboardType:Titanium.UI.KEYBOARD_URL,\r\n hintText:'url',\r\n textAlign:'left',\r\n clearOnEdit:false, // this set to true was clearing the field on launch\r\n height:35,\r\n top:30,\r\n width:300,\r\n borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED\r\n});\r\n\r\nvar streamButton = Titanium.UI.createButton({\r\n title:'Start Streaming',\r\n top:30,\r\n width:200,\r\n height:40\r\n});\r\n\r\nvar pauseButton = Titanium.UI.createButton({\r\n title:'Pause Streaming',\r\n top:30,\r\n width:200,\r\n height:40,\r\n enabled:false\r\n});\r\n\r\nvar progressLabel = Titanium.UI.createLabel({\r\n text:'Time Played: Not Started',\r\n top:30,\r\n left:10,\r\n height:40,\r\n width:300,\r\n color:'#555',\r\n textAlignment:'center'\r\n});\r\n\r\nvar stateLabel = Titanium.UI.createLabel({\r\n text:'State: Not Started',\r\n top:30,\r\n left:10,\r\n width:300,\r\n height:40,\r\n color:'#555'\r\n});\r\n\r\nvar streamSize1 = Ti.UI.createButton({\r\n title:'Small buffer',\r\n top:30,\r\n left:10,\r\n width:100,\r\n height:40\r\n});\r\nvar streamSize2 = Ti.UI.createButton({\r\n title:'Default buffer',\r\n top:30,\r\n left:110,\r\n width:100,\r\n height:40\r\n});\r\nvar streamSize3 = Ti.UI.createButton({\r\n title:'Large buffer',\r\n top:30,\r\n right:10,\r\n width:100,\r\n height:40\r\n});\r\n\r\nwin.add(url);\r\nwin.add(streamButton);\r\nwin.add(pauseButton);\r\nwin.add(progressLabel);\r\nwin.add(stateLabel);\r\n\r\nif (Ti.Platform.name != 'android') {\r\n win.add(streamSize1);\r\n win.add(streamSize2);\r\n win.add(streamSize3);\r\n}\r\n\r\nvar streamer = Ti.Media.createAudioPlayer();\r\n\r\nstreamButton.addEventListener('click',function()\r\n{\r\n if (streamButton.title == 'Stop Stream')\r\n {\r\n progressLabel.text = 'Stopped';\r\n streamer.stop();\r\n pauseButton.enabled = false;\r\n streamSize1.enabled = true;\r\n streamSize2.enabled = true;\r\n streamSize3.enabled = true;\r\n pauseButton.title = 'Pause Streaming';\r\n streamButton.title = \"Start Streaming\";\r\n }\r\n else\r\n {\r\n progressLabel.text = 'Starting ...';\r\n streamer.url = url.value;\r\n streamer.start();\r\n pauseButton.enabled = true;\r\n streamSize1.enabled = false;\r\n streamSize2.enabled = false;\r\n streamSize3.enabled = false;\r\n\r\n pauseButton.title = 'Pause Streaming';\r\n streamButton.title = \"Stop Stream\";\r\n }\r\n});\r\n\r\npauseButton.addEventListener('click', function()\r\n{\r\n streamer.pause();\r\n if (streamer.paused) {\r\n pauseButton.title = 'Unpause Streaming';\r\n }\r\n else {\r\n pauseButton.title = 'Pause Streaming';\r\n }\r\n});\r\n\r\nstreamSize1.addEventListener('click', function()\r\n{\r\n streamer.bufferSize = 512;\r\n Ti.API.log('Set streamer buffer size to ' + streamer.bufferSize);\r\n});\r\nstreamSize2.addEventListener('click', function()\r\n{\r\n streamer.bufferSize = 2048;\r\n Ti.API.log('Set streamer buffer size to ' + streamer.bufferSize);\r\n});\r\nstreamSize3.addEventListener('click', function()\r\n{\r\n streamer.bufferSize = 4096;\r\n Ti.API.log('Set streamer buffer size to ' + streamer.bufferSize);\r\n});\r\n\r\nstreamer.addEventListener('progress',function(e)\r\n{\r\n Ti.API.info('EAC LOGGING: Progress: '+e.progress);\r\n progressLabel.text = 'Time Played: ' + Math.round(e.progress) + ' seconds';\r\n});\r\n\r\nstreamer.addEventListener('change',function(e)\r\n{\r\n stateLabel.text = 'State: '+e.description +' ('+e.state+')';\r\n if(e.description == \"stopped\") {\r\n progressLabel.text = 'Stopped';\r\n pauseButton.enabled = false;\r\n pauseButton.title = 'Pause Streaming';\r\n streamButton.title = \"Start Streaming\";\r\n }\r\n});\r\n\r\n// save off current idle timer state\r\nvar idleTimer = Ti.App.idleTimerDisabled;\r\n\r\n// while we're in this window don't let the app shutdown\r\n// when the screen is idle\r\nTi.App.idleTimerDisabled = true;\r\n\r\nwin.addEventListener('close',function()\r\n{\r\n Ti.API.info(\"window was closed, idleTimer reset to = \"+idleTimer);\r\n\r\n // restore previous idle state when closed\r\n Ti.App.idleTimerDisabled = idleTimer;\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Media - AudioPlayer progress event units of measure not consistent between 1.7.X and 1.8.0.X", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [ { "id": "181614", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Discussed with Blain and ms is the correct unit for MediaPlayer. Closing bug as invalid", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-03T14:30:26.000+0000", "updated": "2012-02-03T14:30:26.000+0000" }, { "id": "411608", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-13T22:14:12.000+0000", "updated": "2017-03-13T22:14:12.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }