YouTube Player API video playback pauses in Multi Window on Android N - youtube-api

When I play a video using YouTube Player API and open another application in multi-window mode my activity receives onPause and video playback pauses. I expected YouTube Player API to follow the guidelines at http://developer.android.com/preview/features/multi-window.html#lifecycle
"we recommend that activities that play video not pause the video in their onPause() handlers. Instead, they should pause video in onStop(), and resume playback in onStart()."
YouTube app works as expected.

Related

How to block ads in Youtube embed video?

I have a slider on my website below and I'm trying to play a Youtube video in the background.
https://aremajans.com/
When I add a Youtube video, ads automatically start playing on that video. How will I prevent this?

Recording video with audio using "AVCaptureSession" while background music is playing (iTunes, Spotify)

I am trying to record videos with audio (using "AVCaptureSession") while background music keeps playing from any music player such as iTunes or Spotify.
The CameraViewController is the the default page, so it would be convenient not to pause the user's background music while he/she records a video.
Really hoping someone can help with this issue.

Enable the background music back after the app plays a video

I have an app that at the beginning plays a video with AVPlayer. The video is muted. The problem is it stops the music that let say iPhone was playing on iTunes and after the video playback is finished the music does not come back automatically. Is there a way to play the video in my app, during the playback of the video the music on iTunes can be muted which is fine with me, but what I want to achieve is to get the iTunes music back playing when the video is finished without the user's interference.

Dailymotion api stop video

I am using their api: dailmotion api
How do I stop the video from downloading?
I know I can use pause, but this will continue to use bandwidth, I want to stop it and later load new video on demand.
You basically can't control that behavior from the player API. Once the video
starts (either when the user clicks plays or if autoplay is enabled), the player
will start to download the video stream and will handle how it's downloaded.

Switch HLS video stream to audio when app goes in background

I am using HTTP Live Streaming Protocol to stream video and audio on demand in my app. The video playlist (m3u8 file) has an audio only version which is playing when the connection is very poor. When the app goes in background I want to play the audio of the video. Is there a way to achieve this, like forcing the MPMoviePlayer to switch to audio only, and then when they open the app to switch to a video version.

Resources