What is the YouTube's PlayerState during pre-roll ad?

后端 未结 1 1755
你的背包
你的背包 2020-12-15 15:30

The Flash YouTube API getPlayerState() method has 6 possible values:

  • -1 (unstarted)
  • 0 (ended)
  • 1 (playing)
  • 2 (paused)
  • 3 (buf
相关标签:
1条回答
  • 2020-12-15 15:31

    I did the legwork for you at https://developers.google.com/youtube/youtube_player_demo

    Cuing a video with a preroll and then clicking Play leads to:

    1. onStateChange event: Player state changed to: "-1" (undefined)
    2. cueVideoById(cggNqDAtJYU, parseInt(0), default);
    3. onStateChange event: Player state changed to: "5" (video cued)
    4. onStateChange event: Player state changed to: "2" (paused)

    So the video's state is PAUSED (2) while the ad is playing. Additionally, calls to playVideo() or pauseVideo() will be no-ops during a preroll.

    0 讨论(0)
提交回复
热议问题