Skip to content

Commit

Permalink
fix: player el ingest when parent doesn't have hasAttribute method (#…
Browse files Browse the repository at this point in the history
…3929)

For elements which parent doesn't have `hasAttribute` it needs do another check to prevent erroring out. One case of this is when video.js is created inside a documentFragment, the parent node won't have a `hasAttribute` method.
  • Loading branch information
stramel authored and gkatsev committed Jan 11, 2017
1 parent d290db1 commit bbe8253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ class Player extends Component {
createEl() {
const tag = this.tag;
let el;
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute('data-vjs-player');
const playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player');

if (playerElIngest) {
el = this.el_ = tag.parentNode;
Expand Down

0 comments on commit bbe8253

Please sign in to comment.