[TIMOB-16106] Android: Support rendering the Video Player in background mode
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | Release 3.2.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, videoplayer |
Reporter | Ludovic |
Assignee | Unknown |
Created | 2013-05-06T20:51:40.000+0000 |
Updated | 2018-02-28T20:03:18.000+0000 |
Description
I have to use the VideoPlayer to play music on Android (because I have to retrieve the duration dynamically, etc...).
The background mode with a VideoPlayer works great on iOS (with Info.plist), but it doesn't work on Android. How can I do avoid the VideoPlayer stop when I quit the app ?
I've the lastest Titanium Mobile SDK 3.2.
Can you elaborate on the background mode for iOS please? If by that you mean that you have a view visible over the playing video (song in your case), then that is only possible on iOS. From the docs for the android video player: On Android, the video player cannot switch modes. To create a fullscreen player, you must specify fullscreen: true when you create the player. This fullscreen player creates its own Android Activity on top of the activity stack. Unlike a normal view, this fullscreen video player appears as soon as it is created. The user can close the player by pressing the Back button. See the code examples for a sample using the fullscreen player on Android. The same activity will not be possible on android because of the way the video player is put on top of the activity stack, nothing else is able to be run on top of it while it is playing. Sorry for the inconvenience but this is a limitation on the android OS, not on Titanium. If you have any other questions feel free to ask. Regards, Carter
Reopening this ticket as it is a valid enhancement request.
Moving this enhancement request to engineering for further evaluation and prioritization. Requirement: Allow audio of a video to be played in the background when the phone is locked. Titanium supports this functionality for iOS platform but not for Android. How to enable this functionality in iOS platform: Java Script file: Ti.Media.audioSessionMode = Ti.Media.AUDIO_SESSION_MODE_PLAYBACK; tiapp.xml file: