smedic / Android-YouTube-Background-Player

YouTube background player
Apache License 2.0
157 stars 55 forks source link

Need add YouTubePlayerView #6

Closed gmavenis closed 8 years ago

gmavenis commented 8 years ago

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

smedic commented 8 years ago

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

gmavenis commented 8 years ago

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.

smedic commented 8 years ago

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.

gmavenis commented 8 years ago

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)

smedic commented 8 years ago

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).