#266 ✓ checked-in
Scott Downe

improve functionality of data-timeline-sources

Reported by Scott Downe | January 17th, 2011 @ 03:14 PM | in 0.3 release date

We need to handle multiple files, separated by comma in the data-timeline-sources

Along with different types of parsers.

Code to do this here:

  dataSources = video.getAttribute( "data-timeline-sources" ).split(",");

  if ( dataSources.length )  {

    Popcorn.forEach( dataSources, function ( source ) {

      dataTemp = source.split( "." );

      dataType = ( dataTemp[ dataTemp.length - 1 ] ).toUpperCase(); 

      parserFn = "parse" + ( dataTemp[ dataTemp.length - 1 ] ).toUpperCase();

      //  If the video has data sources and the correct parser is registered, continue to load
      if ( dataSources && Popcorn.parsers[ dataType ] ) {

        //  Set up the video and load in the datasources
        popcornVideo = Popcorn( "#" + video.id )[ parserFn ]( source );



  //  Only play the video if it was specified to do so
  if ( !!popcornVideo.autoplay ) {

Unit tests if at all possible.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

People watching this ticket

Referenced by