android-youtube-player icon indicating copy to clipboard operation
android-youtube-player copied to clipboard

Load next/previous vedio when use playlist

Open x3rocode opened this issue 3 years ago • 0 comments

Feature Request

Describe your idea

Thanks for the addition of new features that using playlist.

  1. Load next/previous vedio when use playlist
  • I can't found next or prev button when using playlist ( This feature is already provided by YouTube API V3. ). or get current video number, and the total number of videos to changing vedio.
  1. Sign with google to use YouTube Premium (remove ads, play private viedos) I found solution !!!!!!! here
  • I don't know it's possible. for using YouTube Premium sign in Google and choose account before playing video to playing private viedos (or playlists) and remove ads. I tried get an access token using OAuth2.0 to use the permission. However, it is not compatible with the 'YouTubePlayerView' library provided by youtube.
  1. Get total time of current viedo.

Expected behavior and realization

private lateinit var player: YouTubePlayer
                     :
youTubePlayerView.initialize(API_KEY, this@MainActivity)

playbtn.setOnClickListener {
            player.play()
        }
pausebtn.setOnClickListener {
            player.pause()
        }

prevbtn.setOnClickListener {
           if(player.hasPrevious){
                    player.previous()
            }
        }
nextbtn.setOnClickListener {
           if(player.hasNext){
                    player.next()
            }
        }
                :

override fun onInitializationSuccess(
        p0: YouTubePlayer.Provider?,
        p1: YouTubePlayer?,
        p2: Boolean
    ) {
        /** add listeners to YouTubePlayer instance **/
        p1?.setPlayerStateChangeListener(playerStateChangeListener);
        p1?.setPlaybackEventListener(playbackEventListener);

        if (!p2) {
            p1?.cuePlaylist(PlayList_ID);
        }
        player = p1!!
    }

image image

x3rocode avatar Sep 16 '22 01:09 x3rocode