From 6045dd9fb2963bdbc094bdecff0be38ec0844d45 Mon Sep 17 00:00:00 2001 From: rwldrn Date: Mon, 17 Jan 2011 15:25:45 -0500 Subject: [PATCH] [#266] Fixed 'data-timeline-sources' is null bug --- popcorn.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/popcorn.js b/popcorn.js index 9079278..c6953e7 100644 --- a/popcorn.js +++ b/popcorn.js @@ -861,13 +861,16 @@ Popcorn.forEach( videos, function ( iter, key ) { var video = videos[ key ], + hasDataSources = false, dataSources, dataTemp, dataType, parserFn, popcornVideo; - + // Ensure we're looking at a dom node and that it has an id // otherwise Popcorn won't be able to find the video element if ( video.nodeType && video.nodeType === 1 && video.id ) { + + popcornVideo = Popcorn( "#" + video.id ); - dataSources = video.getAttribute( "data-timeline-sources" ).split(","); + dataSources = ( video.getAttribute( "data-timeline-sources" ) || "" ).split(","); if ( dataSources.length ) { @@ -883,7 +886,7 @@ if ( dataSources && Popcorn.parsers[ dataType ] ) { // Set up the video and load in the datasources - popcornVideo = Popcorn( "#" + video.id )[ parserFn ]( source ); + popcornVideo[ parserFn ]( source ); } -- 2.43.0