{ "id": "62240", "key": "TIMOB-1608", "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": [ { "id": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-07-22T17:55:33.000+0000", "created": "2011-04-15T02:57:15.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "audioplayer", "interrupt", "ios", "ipass1", "supportTeam" ], "versions": [], "issuelinks": [ { "id": "30339", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "117472", "key": "TIMOB-14627", "fields": { "summary": "Android: Expose the constant \"android.intent.action.PHONE_STATE\"", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T16:05:08.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": "h6.Issue\r\ncreateAudioPlayer() do not stop audio playback on an incoming. No events actually passed through these objects in order to check for calls.\r\n\r\nh6.Target environment\r\nTiSDK 3.1.1.GA & new HTC One/Android 4.1.2 \r\n\r\nh6.Sample\r\nTo reproduce run snippet, start audio playback then call to phone. \r\n{code}\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Audio Test',\r\n backgroundColor:'#fff',\r\n layout: 'vertical'\r\n});\r\n\r\nvar startStopButton = Titanium.UI.createButton({\r\n title:'Start/Stop Streaming',\r\n top:10,\r\n width:200,\r\n height:40\r\n});\r\n\r\nvar pauseResumeButton = Titanium.UI.createButton({\r\n title:'Pause/Resume Streaming',\r\n top:10,\r\n width:200,\r\n height:40,\r\n enabled:false\r\n});\r\n\r\nwin.add(startStopButton);\r\nwin.add(pauseResumeButton);\r\n\r\n// allowBackground: true on Android allows the \r\n// player to keep playing when the app is in the \r\n// background. \r\nvar audioUrl = 'http://broadcast.infomaniak.net:80/energyzuerich-high.mp3';\r\nvar audioPlayer = Ti.Media.createAudioPlayer({ \r\n url: audioUrl,\r\n allowBackground: true\r\n}); \r\n \r\nstartStopButton.addEventListener('click',function() {\r\n // When paused, playing returns false.\r\n // If both are false, playback is stopped.\r\n if (audioPlayer.playing || audioPlayer.paused)\r\n {\r\n audioPlayer.stop();\r\n pauseResumeButton.enabled = false;\r\n if (Ti.Platform.name === 'android')\r\n { \r\n audioPlayer.release();\r\n } \r\n }\r\n else\r\n {\r\n audioPlayer.start();\r\n pauseResumeButton.enabled = true;\r\n }\r\n});\r\n\r\npauseResumeButton.addEventListener('click', function() {\r\n if (audioPlayer.paused) {\r\n audioPlayer.start();\r\n }\r\n else {\r\n audioPlayer.pause();\r\n }\r\n});\r\n\r\naudioPlayer.addEventListener('progress',function(e) {\r\n Ti.API.info('Time Played: ' + Math.round(e.progress) + ' milliseconds');\r\n});\r\n\r\naudioPlayer.addEventListener('change',function(e)\r\n{\r\n Ti.API.info('State: ' + e.description + ' (' + e.state + ')');\r\n});\r\n\r\nwin.addEventListener('close',function() {\r\n audioPlayer.stop();\r\n if (Ti.Platform.osname === 'android')\r\n { \r\n audioPlayer.release();\r\n }\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "40442", "filename": "Razr_2.3.5_AudioPlayer_CallIncoming.txt", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-07-01T20:25:21.000+0000", "size": 548291, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Audio not stopped on incoming call", "creator": { "name": "andrewheebner", "key": "andrewheebner", "displayName": "Andrew Heebner", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "andrewheebner", "key": "andrewheebner", "displayName": "Andrew Heebner", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.1.GA\r\nNew HTC One/Android 4.1.2 or Razr 2.3.5", "comment": { "comments": [ { "id": "126180", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}
May actually be valid; not necessarily a call interrupt (which\nwe do check for, I believe, and which users can handle). Would have\nto be fired on the media module.
\nTagging for both iOS and Android, though this was originally\nfiled for Android only.
On iOS, it does not look like the AudioStreamerCUR is currently\nlistening for interruptions:
\n\n#ifdef TARGET_OS_IPHONE \n//\n// MyAudioSessionInterruptionListener\n//\n// Invoked if the audio session is interrupted (like when the phone rings)\n//\n// TODO: Need to add this into the interruption framework, it's a bug!\nvoid MyAudioSessionInterruptionListenerCUR(void *inClientData, UInt32 inInterruptionState)\n{\n AudioStreamerCUR* streamer = (AudioStreamerCUR *)inClientData;\n [streamer handleInterruptionChangeToState:inInterruptionState];\n}\n#endif
\n