]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#310] Changes per review
authorrwldrn <waldron.rick@gmail.com>
Tue, 8 Feb 2011 20:58:30 +0000 (15:58 -0500)
committerrwldrn <waldron.rick@gmail.com>
Tue, 8 Feb 2011 20:58:30 +0000 (15:58 -0500)
popcorn.js

index e8ebee737689246326bbb7afa546befd4aa9e89b..0c5b01f971d3779a7ff566274a19f5a5239ac363 100644 (file)
   
   //  Exposes Popcorn to global context
   global.Popcorn = Popcorn;
-  
+
   document.addEventListener( "DOMContentLoaded", function () {
 
     var videos = document.getElementsByTagName( "video" );
     Popcorn.forEach( videos, function ( iter, key ) {
 
       var video = videos[ key ],
-          hasDataSources = false, 
+          hasDataSources = false,
           dataSources, dataTemp, dataType, parserFn, popcornVideo;
-      
-      //  Ensure that the DOM has an id, satisfies #310
+
+      //  Ensure that the DOM has an id
       if ( !video.id ) {
+
         video.id = Popcorn.guid( "__popcorn" );
+
       }
       
-      //  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 ) {
+      //  Ensure we're looking at a dom node
+      if ( video.nodeType && video.nodeType === 1 ) {
       
         popcornVideo = Popcorn( "#" + video.id );
 
             dataTemp = source.split( ":" );
 
             dataType = dataTemp[0];
-            
+
             if ( dataTemp.length === 1 ) {
-              
+
               dataTemp = source.split( "." );
-              
+
               dataType = dataTemp[ dataTemp.length - 1 ]; 
-              
+
             }
-            
+
             dataType = dataType.toUpperCase();
-     
+
             parserFn = "parse" + dataType;
 
             //  If the video has data sources and the correct parser is registered, continue to load