0

The documentation on jPlayer.org doesn't seem to include anything on how to create a video playlist such as the one shown as a demo. How can I create a pre-defined playlist with jPlayer?

If it helps to know, I'm hoping to automatically prepend an ad before playing videos on my site.

leppie
  • 115,091
  • 17
  • 196
  • 297
beth
  • 1,916
  • 4
  • 23
  • 39

1 Answers1

2

You can take a look at the sourcecode of their demo page. You will see how they setup both jPlayerPlaylist objects.

$(document).ready(function(){

new jPlayerPlaylist({
    jPlayer: "#jquery_jplayer_1",
    cssSelectorAncestor: "#jp_container_1"
}, [
    {
        title:"Big Buck Bunny Trailer",
        artist:"Blender Foundation",
        free:true,
        m4v:"http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v",
        ogv:"http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
        webmv: "http://www.jplayer.org/video/webm/Big_Buck_Bunny_Trailer.webm",
        poster:"http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
    },
    {
        title:"Finding Nemo Teaser",
        artist:"Pixar",
        m4v: "http://www.jplayer.org/video/m4v/Finding_Nemo_Teaser.m4v",
        ogv: "http://www.jplayer.org/video/ogv/Finding_Nemo_Teaser.ogv",
        webmv: "http://www.jplayer.org/video/webm/Finding_Nemo_Teaser.webm",
        poster: "http://www.jplayer.org/video/poster/Finding_Nemo_Teaser_640x352.png"
    },
    {
        title:"Incredibles Teaser",
        artist:"Pixar",
        m4v: "http://www.jplayer.org/video/m4v/Incredibles_Teaser.m4v",
        ogv: "http://www.jplayer.org/video/ogv/Incredibles_Teaser.ogv",
        webmv: "http://www.jplayer.org/video/webm/Incredibles_Teaser.webm",
        poster: "http://www.jplayer.org/video/poster/Incredibles_Teaser_640x272.png"
    }
], {
    swfPath: "../js",
    supplied: "webmv, ogv, m4v"
});
......

)};
Dmitriy
  • 1,852
  • 4
  • 15
  • 33
  • is this possible that two different jplayer video and circle will use the same play list. – asifaftab87 Mar 31 '14 at 02:22
  • I believe you can extract an array of entries as a play-list and re-use that array in several jPlayerPlaylist instances. – Dmitriy Apr 07 '14 at 15:11
  • Dmitriy sorry to ask this but would you like to describe in brief or give me at least some hints how to achieve this.. – asifaftab87 Apr 08 '14 at 06:06