Skip to content

Commit

Permalink
Merge pull request #27 from ganigeorgiev/master
Browse files Browse the repository at this point in the history
Added video.js v6 support
  • Loading branch information
mrbar42 authored Aug 29, 2017
2 parents 7db656f + 3ca5be6 commit a2a5ff6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/videojs5.hlsjs.js → src/videojs.hlsjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,16 @@ var HlsSourceHandler = {
if (Hls.isSupported()) {
var videojs = require('video.js'); // resolved UMD-wise through webpack

// support es6 style import
videojs = videojs.default || videojs;

if (videojs) {
videojs.getComponent('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
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
entry: __dirname + '/src/videojs5.hlsjs',
entry: __dirname + '/src/videojs.hlsjs',
devtool: 'source-map',
output: {
path: __dirname + '/dist',
Expand Down

0 comments on commit a2a5ff6

Please sign in to comment.