{ "id": "102811", "key": "TIMOB-13397", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "15699", "description": "2013 Sprint 21", "name": "2013 Sprint 21", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "15700", "description": "2013 Sprint 21 API", "name": "2013 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": null, "resolutiondate": null, "created": "2012-10-06T22:45:53.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "module_media", "qe-closed-3.2.0", "qe-testadded", "regression" ], "versions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "issuelinks": [], "assignee": null, "updated": "2018-11-16T12:02:14.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When using Titanium.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD, the audio output is routed to the receiver (the speaker in the earpiece of iPhone). This request would allow you to override this behavior to make the audio play out of the speaker (the speakerphone, located near the doc connector on iPhone).", "attachment": [ { "id": "44541", "filename": "comic001.wav", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T01:29:33.000+0000", "size": 117414, "mimeType": "audio/wav" }, { "id": "44542", "filename": "movie.mp4", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T01:29:33.000+0000", "size": 2549211, "mimeType": "video/mp4" } ], "flagged": false, "summary": "iOS: Add ability to override audio routes", "creator": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "environment": "iOS", "comment": { "comments": [ { "id": "222404", "author": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "body": "Made a Pull Request on Github for this.", "updateAuthor": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "created": "2012-10-06T23:09:06.000+0000", "updated": "2012-10-06T23:09:24.000+0000" }, { "id": "228757", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please could you link the pull request? Thanks.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-28T00:48:10.000+0000", "updated": "2012-11-28T00:48:10.000+0000" }, { "id": "228786", "author": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/3121", "updateAuthor": { "name": "quahada", "key": "quahada", "displayName": "Shashi Jain", "active": true, "timeZone": "America/New_York" }, "created": "2012-11-28T02:20:02.000+0000", "updated": "2012-11-28T02:20:02.000+0000" }, { "id": "274071", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR merged\r\nCreated TIDOC-1291 for documentation", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-10-07T21:12:46.000+0000", "updated": "2013-10-07T21:13:31.000+0000" }, { "id": "283713", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. While setting Ti.Media.audioSessionMode to Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD, verified I was able to route the audio output to either the phone's receiver or to the phone's internal speaker.\n\nTested on:\n\nAppcelerator Studio, build: 3.2.0.201312091648\nSDK build: 3.2.0.v20131210112451\nCLI: 3.2.0-cr\nAlloy: 1.3.0-cr\nXcode: 5.0.2\nDevice: iphone 5 (7.0.2), iphone 4s (6.0.1)\n\n*Note:* \n\nBelow is the code I used to verify this ticket. And, I attached the missing media files that the below code uses.\n\n{code}\nvar window = Ti.UI.createWindow({\n\tbackgroundColor: 'white'\n});\n\nvar scrollView = Ti.UI.createScrollView({\n\tcontentWidth : 'auto',\n\tcontentHeight : 'auto',\n\tshowVerticalScrollIndicator : true,\n\tlayout : 'vertical',\n\theight : '85%',\n\twidth : Ti.UI.FILL\n});\n\nTi.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAY_AND_RECORD;\nvar isToSpeaker = false;\n\nvar toggleOverride = Ti.UI.createButton({\n\ttitle:'Toggle Audio Output'\n}); \ntoggleOverride.addEventListener('click', function(){\n\tif(isToSpeaker){\n\t\t// if routed to speaker, then route to receiver of phone\n\t\tTi.Media.setOverrideAudioRoute(Ti.Media.AUDIO_SESSION_OVERRIDE_ROUTE_NONE);\n\t\talert('audio routed to the phone\\'s receiver');\n\t}\n\telse {\n\t\tTi.Media.setOverrideAudioRoute(Ti.Media.AUDIO_SESSION_OVERRIDE_ROUTE_SPEAKER);\n\t\talert('audio routed to the phone\\'s internal speaker');\n\t}\n\t\n\tisToSpeaker = !isToSpeaker;\n});\nscrollView.add(toggleOverride);\n\n// Video player volume test\nscrollView.add(Ti.UI.createLabel({\n\ttext : 'Video Player',\n\theight : Ti.UI.SIZE,\n\twidth : Ti.UI.SIZE,\n\tcolor : 'black'\n}));\n\nvar videoPlayer = Titanium.Media.createVideoPlayer({\n\theight : 300,\n\twidth : 300,\n\tmediaControlStyle : Ti.Media.VIDEO_CONTROL_DEFAULT,\n\tscalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,\n\turl : 'movie.mp4',\n\tvolume : 0.0\n});\n\nscrollView.add(videoPlayer);\n\nscrollView.add(createVolumeControl(videoPlayer));\n\n// Sound volume test\nscrollView.add(Ti.UI.createLabel({\n\ttext : 'Sound Player',\n\theight : Ti.UI.SIZE,\n\twidth : Ti.UI.SIZE,\n\tcolor : 'black',\n\ttop : 20\n}));\n\nvar sound = Ti.Media.createSound({\n\turl : 'comic001.wav'\n});\nscrollView.add(createVolumeControl(sound));\n\nvar playSoundButton = Ti.UI.createButton({\n\ttitle : \"Play Sound\",\n\theight : Ti.UI.SIZE,\n\twidth : Ti.UI.SIZE\n});\n\nplaySoundButton.addEventListener('click', function() {\n\tif (sound.isPlaying()) {\n\t\tsound.stop();\n\t\tplaySoundButton.title = 'Play Sound';\n\t} else {\n\t\tsound.play();\n\t\tplaySoundButton.title = 'Stop Sound';\n\t}\n\n});\n\nscrollView.add(playSoundButton);\n\n// Audio volume test\nscrollView.add(Ti.UI.createLabel({\n\ttext : 'Audio Player',\n\theight : Ti.UI.SIZE,\n\twidth : Ti.UI.SIZE,\n\tcolor : 'black',\n\ttop : 20\n}));\n\n// TIMOB-9409: iOS cannot play local mp3 files\nvar audio = Ti.Media.createAudioPlayer({\n\turl : 'http://appcelerator.qe.test.data.s3.amazonaws.com/timob8992Music.mp3',\n\tvolume : 0.5\n});\nscrollView.add(createVolumeControl(audio));\n\nvar playAudioButton = Ti.UI.createButton({\n\ttitle : \"Play Audio\",\n\theight : Ti.UI.SIZE,\n\twidth : Ti.UI.SIZE\n});\n\nplayAudioButton.addEventListener('click', function() {\n\tif (audio.playing) {\n\t\taudio.stop();\n\t\tplayAudioButton.title = 'Play Audio';\n\t} else {\n\t\taudio.start();\n\t\tplayAudioButton.title = 'Stop Audio';\n\t}\n\n});\n\nscrollView.add(playAudioButton);\n\nfunction createVolumeControl(player) {\n\tvar slider = Ti.UI.createSlider({\n\t\tvalue : player.volume * 100,\n\t\tmin : 0,\n\t\tmax : 100,\n\t\twidth : Ti.UI.FILL\n\t});\n\n\tslider.addEventListener('change', function(e) {\n\t\tplayer.volume = e.value / 100;\n\t});\n\n\treturn slider;\n};\n\nwindow.add(scrollView);\nwindow.open();\n{code}\n\n", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T01:28:43.000+0000", "updated": "2013-12-11T01:28:43.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }