Skip to content

Commit

Permalink
[pull-27] apply review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Aug 28, 2017
1 parent c442670 commit 3ca5be6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/videojs.hlsjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,16 @@ var HlsSourceHandler = {
if (Hls.isSupported()) {
var videojs = require('video.js'); // resolved UMD-wise through webpack

// we could just use `import videojs from 'video.js'`
// but that will require a `babel-loader` or similar dependency
// support es6 style import
videojs = videojs.default || videojs;

if (videojs) {
videojs.getTech('Html5').registerSourceHandler(HlsSourceHandler, 0);
var html5Tech = videojs.getTech && videojs.getTech('Html5'); // videojs6 (partially on videojs5 too)
html5Tech = html5Tech || (videojs.getComponent && videojs.getComponent('Html5')); // videojs5

if (html5Tech) {
html5Tech.registerSourceHandler(HlsSourceHandler, 0);
}
}
else {
console.warn('videojs-contrib-hls.js: Couldn\'t find find window.videojs nor require(\'video.js\')');
Expand Down

0 comments on commit 3ca5be6

Please sign in to comment.