0

I have managed to embed a youtube video in Flash, using the YouTube ActionScript 3.0 Player API https://developers.google.com/youtube/flash_api_reference.

It's working fine but I need some additional functionality. I have multiple videos on a frame, so the first thing I want to do is

  1. If VIDEO 1 is playing and I click VIDEO 2, I want VIDEO 1 to stop.
  2. I want any video that is playing to stop when I leave the frame.

In regards to the latter, I'm aware I could create a button for navigation and add player.stopVideo(); function to it BUT it gets more complicated because the SWF is inside one of the (horrible) flipping book apps, so the navigation is controlled by the flipping book app, not the actual SWF that contains the videos.

Any workarounds for my 2 problems above?

4

1 に答える 1

0

ビデオにイベント リスナーを追加できます。イベントonStateChangeは次のことに役立ちます。

可能な値は、開始されていない (-1)、終了した (0)、再生中 (1)、一時停止中 (2)、バッファリング中 (3)、ビデオ キューあり (5) です。

次を使用して、他のビデオを開始できます。

player.playVideo()
于 2012-07-05T08:09:54.330 に答える