javascripthtmlpopcornjs

How to run popcornjs sequencer


I'm trying to implement the popcorn sequencer on my website but nothing is running on my website. I'm running the site from localhost. Does the sequencer only work from a server?. Here is my code that I put inside the head of my HTML page. Is there anything wrong with it?.

<script>   
    document.addEventListener( "DOMContentLoaded", function() {
        var sequence = Popcorn.sequence("container",
            [
              {
                src: "videos/LugaMantanah.mp4",
                in: 0,
                out: 15
              },
              {
               src: "videos/LugaMantanahAreaCodes.mp4",
               in: 7,
               out: 23
             },
             {
               src: "videos/lugamantanahHeartandSoul.mp4",
               in: 15,
               out: 30
             }
             {
               src: "videos/Makeurbed.mp4",
               in: 13,
               out: 28
             }
            ]);

            sequence.play();
            // get popcorn object of first video
    console.log( sequence.eq( 0 ) );

    //exec something at 4 seconds
    sequence.exec( 4, function() {
        console.log( "AT 4 SECONDS" );
    });    
    }, false);
    </script>

Here is what I put inside of the body.

<div id="container"></div>

Solution

  • There is a comma missing between lines 19 and 20.