How to embed and play a YouTube video in android

前端 未结 6 627
粉色の甜心
粉色の甜心 2021-02-05 18:11

Can we watch youtube video in android app? I mean if we have link to video on youtube, can we play it in VideoView or another widget? Any ideas about it?

6条回答
  •  一向
    一向 (楼主)
    2021-02-05 18:47

    Can integrate youtube videos using youtube sdk

    with youtube sdk you can have many options while integrating a video

    for more http://www.androidcoding.in/2017/12/17/android-play-youtube-video-play-youtube-video-app/

    private final class StateChangeListener implements YouTubePlayer.PlayerStateChangeListener {
    
    @Override
     public void onLoading() {
     }
    
     @Override
     public void onLoaded(String s) {
      }
    
      @Override
      public void onAdStarted() {
      }
    
      @Override
       public void onVideoStarted() {
       }
    
       @Override
       public void onVideoEnded() {
       }
    
        @Override
       public void onError(YouTubePlayer.ErrorReason errorReason) {
            }
           }
    

提交回复
热议问题