JavaScript Brightcove API pause and play

Novak picture Novak · Aug 9, 2012 · Viewed 8.7k times · Source

I'm having a hard time understanding how to do those simple actions. I tried to follow the API, and suggestions from several forums, but I ended up with 404 pages that don't exist anymore, and I hope you can guide me.

I have 3 videos on my page, and I'm trying to achieve the next functionality:

  • When a video ends, it will play the next.
  • When you play a video, the others will be paused.

I am looking for a reference for the above, so I can follow it, to build the desired functionality.

Answer

Mark picture Mark · Aug 10, 2012

The best documentation is at http://support.brightcove.com/en/docs/using-smart-player-api.

There is an example of loading in one video once another is finished at http://support.brightcove.com/en/docs/dynamically-loading-videos-using-smart-player-api and more details on listening for events at http://support.brightcove.com/en/docs/listening-events-using-smart-player-api.

The API documentation for the VideoPlayer module is at http://docs.brightcove.com/en/video-cloud/smart-player-api/reference/symbols/brightcove.api.modules.VideoPlayerModule.html. Have a look at the methods such as loadVideoByID(), play() and pause(). You might also want to check out the MediaEvent API at http://docs.brightcove.com/en/video-cloud/smart-player-api/references/symbols/brightcove.api.events.MediaEvent.html.

Cheers Mark