Skip to content

Commit

Permalink
added videojs v6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Aug 27, 2017
1 parent 7db656f commit c442670
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/videojs5.hlsjs.js → src/videojs.hlsjs.js
Original file line number Diff line number Diff line change
@@ -150,8 +150,12 @@ 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
videojs = videojs.default || videojs;

if (videojs) {
videojs.getComponent('Html5').registerSourceHandler(HlsSourceHandler, 0);
videojs.getTech('Html5').registerSourceHandler(HlsSourceHandler, 0);
}
else {
console.warn('videojs-contrib-hls.js: Couldn\'t find find window.videojs nor require(\'video.js\')');
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',

0 comments on commit c442670

Please sign in to comment.