]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#310] Inject id to video if none exists
authorrwldrn <waldron.rick@gmail.com>
Tue, 8 Feb 2011 17:46:20 +0000 (12:46 -0500)
committerrwldrn <waldron.rick@gmail.com>
Tue, 8 Feb 2011 17:46:20 +0000 (12:46 -0500)
popcorn.js

index 87c06dbdbfc0e1b339d5cbe37e9ca12526d20a43..e8ebee737689246326bbb7afa546befd4aa9e89b 100644 (file)
           hasDataSources = false, 
           dataSources, dataTemp, dataType, parserFn, popcornVideo;
       
+      //  Ensure that the DOM has an id, satisfies #310
+      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 ) {