Permalink
Browse files

feat: add warning if the element given to Video.js is not in the DOM (#…

…4698)

Addresses #4697.
  • Loading branch information...
odisei369 authored and gkatsev committed Nov 1, 2017
1 parent ad1b47b commit 6f713ca7132cf3210742dc9080047d6fc477a901
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/js/video.js
View
@@ -99,6 +99,11 @@ function videojs(id, options, ready) {
throw new TypeError('The element or ID supplied is not valid. (videojs)');
}
// Check if element is included in the DOM
if (Dom.isEl(tag) && !document.body.contains(tag)) {
log.warn('The element supplied is not included in the DOM');
}
// Element may have a player attr referring to an already created player instance.
// If so return that otherwise set up a new player below
if (tag.player || Player.players[tag.playerId]) {

0 comments on commit 6f713ca

Please sign in to comment.