You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ojw28 Need your comments or suggestions, on below issue.
I am trying to run background audio playback when a user leaves video player activity. I wrote service for that and I am handling ExoPlayer in service, Background play is working fine when I leave application at that time I am setting "setBackgrounded(true)" . When I am returning back to an application and open video player activity, here first I am checking if something is playing or not in service, if yes then use "setBackgrounded(false)" and attach surfaceView to show video.
In the above-described method, I am facing two problems, which I discussed below.
Reproduce steps in ExoPlayer demo application :
Start demo application, go HLS section, select first video name "Apple master playlist".
play this video.
pause this video at any time and note down MM:SS from seekbar and video display. [refer before.png]
Press home screen, by doing this activity goes to onResume() method and below code will be executed
Note : It will set player in background mode as I enabled enableBackgroundAudio=true.
After few seconds come back to ExoPlayer Demo application by pressing "Overview" button and select ExoPlayer from it. Now compare seek-bar time and time which video frame displays. [Refer after.png file]
Problem 1 : Both are different, now press the play button and you can see video frame will not refresh until seek bar will not sync with it.
It means the video frames are still downloading/rendering when a player is paused and setBackgrounded is true.
Problem 2 : In step three if we won't pause a video and put an application in background mode and come back to the application, audio is playing and it's perfectly fine but when I came back to exoplayer demo application (foreground mode), I can see video frame is getting freeze for few seconds (5-6 seconds, sometimes I can see only black screen). It will be in sync with the seek bar after few seconds. (In this case also, audio and video downloading rate are different.)
Is this problem of audio and video downloading mismatch or video downloading happening with pause and setBackgrounded(true).
The text was updated successfully, but these errors were encountered:
saurabhkpatel
changed the title
setBackgrounded(true) not working as expected in HLS video. (Video frame does not render for a while, after coming back to activity)
setBackgrounded(true) not working as expected in HLS video. (Video and audio downloading mismatch, while coming back to activity )
Jul 26, 2016
@ojw28 Is there any update on this issue, I posted 1 week before. If you require more information about this then please let me know i can provide you more details.
This is basically boils down to being able to smoothly switch/detach/attach surfaces, which is discussed and tracked in #677.
Note: You appear to be using ExoPlayer V1 still, which is pretty old at this point. You should consider migrating to V2, where we've been making improvements in this area.
@ojw28 : First of thanks for your reply on this thread after more than 11 Months. I reported this issue last summer at that time version 2 was not out.
I will try with version 2 and update the information in the new thread if require.
@ojw28 Need your comments or suggestions, on below issue.
I am trying to run background audio playback when a user leaves video player activity. I wrote service for that and I am handling ExoPlayer in service, Background play is working fine when I leave application at that time I am setting "setBackgrounded(true)" . When I am returning back to an application and open video player activity, here first I am checking if something is playing or not in service, if yes then use "setBackgrounded(false)" and attach surfaceView to show video.
In the above-described method, I am facing two problems, which I discussed below.
Reproduce steps in ExoPlayer demo application :
Note : It will set player in background mode as I enabled enableBackgroundAudio=true.
Problem 1 : Both are different, now press the play button and you can see video frame will not refresh until seek bar will not sync with it.
It means the video frames are still downloading/rendering when a player is paused and setBackgrounded is true.
Problem 2 : In step three if we won't pause a video and put an application in background mode and come back to the application, audio is playing and it's perfectly fine but when I came back to exoplayer demo application (foreground mode), I can see video frame is getting freeze for few seconds (5-6 seconds, sometimes I can see only black screen). It will be in sync with the seek bar after few seconds. (In this case also, audio and video downloading rate are different.)
Is this problem of audio and video downloading mismatch or video downloading happening with pause and setBackgrounded(true).
There any workaround to solve this problem?
You can find changes in demo application over here : saurabhkpatel@78b7c66
Attachments :
Before.png
After.png
The text was updated successfully, but these errors were encountered: