This page includes the continued description from the Playing video and Playing audio pages. You are requested to go through the mentioned pages first to gain a better understanding of the following explanation.
It is possible to configure the Yendif Player playlist only through the JavaScript method. The following example will help you understand how you can add a playlist in your player:
A basic video playlist
// ensure DOM is ready $(function () { // this will install yendifplayer into an element with id="player" $("#player").yendifplayer ({ videos:[{ mp4:"http://mydomain.org/video1.mp4", poster:"http://mydomain.org/poster1.jpg" },{ mp4:"http://mydomain.org/video2.mp4", poster:"http://mydomain.org/poster2.jpg" },{ mp4:"http://mydomain.org/video3.mp4", poster:"http://mydomain.org/poster3.jpg" }] }); });
A basic audio playlist
// ensure DOM is ready $(function () { // this will install yendifplayer into an element with id="player" $("#player").yendifplayer ({ audios:[ {mp3:"http://mydomain.org/audio1.mp3"}, {mp3:"http://mydomain.org/audio2.mp3"}, {mp3:"http://mydomain.org/audio3.mp3"} ] }); });
On comparing playlists with the single media input formats, you will probably observe a minor difference. Literal notation {…} is used to add a single media. However, while creating a playlist, you have to use an array […] to add more than one audio/video objects.