Youtube Api android autostart

后端 未结 6 1513
梦谈多话
梦谈多话 2020-12-01 10:56

I use Youtube Api in my app, but my problem is it\'s not auto play, must press play button.

My code is:

setContentView(R.layout.playerview_demo);
((Y         


        
6条回答
  •  没有蜡笔的小新
    2020-12-01 11:18

    Using loadVideo function.

    public abstract void loadVideo (String videoId, int timeMillis)
    

    Loads and plays the specified video. Playback will start at the specified time in the video.

    videoId - The ID of the video to be played timeMillis - The time in milliseconds

    FYR: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer#loadVideo(java.lang.String)reader

提交回复
热议问题