Youtube Video Autoplay in popup

前端 未结 4 1379
一向
一向 2021-02-03 11:08

I\'ve made a popup and placed a youtube video in it. I set video to autoplay. But the problem is video plays when i open the page. It is auto play in global and i want it to aut

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 11:42

    From the YouTube JavaScript Player API Reference:

    The JavaScript API allows users to control the YouTube chromeless or embedded video players via JavaScript. Calls can be made to play, pause, seek to a certain time in a video, set the volume, mute the player, and other useful functions.

    You can use the API's player.playVideo(), player.pauseVideo() and player.stopVideo() method.

提交回复
热议问题