Youtube Api android autostart

后端 未结 6 1508
梦谈多话
梦谈多话 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

    The documentation clearly states...

    Note: YouTube only counts playbacks that are initiated through the native play button.

    but u could simply call youtubeplayer.loadVideo(VIDEO_ID,0) // 0 millis, start right away

    Otherwise you could use CHROMELESS controls and add custom controls to it. Then it may work. All the best..

提交回复
热议问题