From: rwldrn Date: Tue, 8 Feb 2011 17:46:20 +0000 (-0500) Subject: [#310] Inject id to video if none exists X-Git-Tag: v0.3~9^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d436f9b767ca5001b12b09b5d9d5d321a320fd70;p=popcorn-js.git [#310] Inject id to video if none exists --- diff --git a/popcorn.js b/popcorn.js index 87c06db..e8ebee7 100644 --- a/popcorn.js +++ b/popcorn.js @@ -962,6 +962,11 @@ 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 ) {