smedic/Android-YouTube-Background-Player

Need add YouTubePlayerView

gmavenis opened this issue · 5 comments

I like your app and thanks so much.
But app only play in background, and is controlled via notification.
I want it can show both YouTubePlayerView and notification.
I tried do it, but YouTubePlayerView run not matched time with in background.
Please help me. Thanks

Hello.
You want to watch video + listen to music (if I understood correctly) ?

Hi,
Yes that's right.
In foreground, I want to watch video in Activity.
In background, I want to listen music as your app.
But when Activity resume (audio playing at time xx:xx), video will play continue at xx:xx.

You want to watch one video in YouTubePlayerView and to listen totally different audio in background?
I am playing music by using MediaPlayer, so this can cause problem with time synchronization.

My problem, if you can add YouTubePlayerView in your app.
When activity running, video play.
When activity paused, audio play.
=> Both run at same timeInMillis, and can be controlled pause, play, stop at 2 places (on video frame controller and notification controller)

Application is not intended to be used for watching videos, just for playing music.
But you can whatever you like.
Start YoutubePlayerView and when activity onResume is triggered, just send Intent to service to start playback from specific time (provide time in Intent extras).