Prevent multiple instances on one element

This commit is contained in:
Sam Potts 2015-02-18 16:17:27 +11:00
parent c7c48bbe3c
commit aa39aa8a58
2 changed files with 5 additions and 3 deletions

View File

@ -967,9 +967,11 @@
for (var i = elements.length - 1; i >= 0; i--) {
// Get the current element
var element = elements[i];
// Setup a player instance and add to the element
element.plyr = new Plyr(element);
if(typeof element.plyr === "undefined") {
element.plyr = new Plyr(element);
}
// Add to return array
players.push(element.plyr);

2
dist/js/plyr.js vendored

File diff suppressed because one or more lines are too long