Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16106] Android: Support rendering the Video Player in background mode

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, videoplayer
ReporterLudovic
AssigneeUnknown
Created2013-05-06T20:51:40.000+0000
Updated2018-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.

Comments

  1. Carter Lathrop 2013-05-07

    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
  2. Ritu Agrawal 2013-12-30

    Reopening this ticket as it is a valid enhancement request.
  3. Ritu Agrawal 2013-12-30

    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: audio Ti.Media.AUDIO_SESSION_MODE_PLAYBACK is supported only for iOS platform and not for Android so this feature request is essentially to support the same functionality on both platforms. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Media-property-AUDIO_SESSION_MODE_PLAYBACK There are a number of Q&A threads on this request: https://developer.appcelerator.com/question/136155/allowbackground-on-videoplayer- https://developer.appcelerator.com/question/144456/keep-videoplayer-alive-when-screen-is-off-background-playback-videoplayer

JSON Source