-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Previously I was using a fork of the videojs-hlsjs-plugin library in my project so I could update HLS.js and make a few tweaks to the code.
I noticed recently that subtitles weren't working (at all) for me, so I decided to try using the latest version of the plugin to see if maybe it's a bug that was fixed, or an incompatibility between my version of the plugin and my version of HLS.js.
At first I installed like so:
npm install --save videojs-hlsjs-plugin
This gave the warning:
npm WARN deprecated videojs-hlsjs-plugin@1.0.5: Deprecated in favor of @streamroot/videojs-hlsjs-plugin
So I tried out @streamroot/videojs-hlsjs-plugin:
npm uninstall --save videojs-hlsjs-plugin
npm install --save videojs-hlsjs-plugin
In my initialization code (I'm using Webpack for building, so ES6 imports work just fine) I originally had the following code, which was working with my fork:
import videojs from "video.js";
import hlsPlugin from "videojs-hlsjs-plugin";
hlsPlugin.register(videojs);
I updated videojs-hlsjs-plugin to @streamroot/videojs-hlsjs-plugin and my video failed to load, throwing the error:
TypeError: hlsPlugin.register is not a function
I tried using require instead of import per the README, but got the same error:
import videojs from "video.js";
const hlsPlugin = require("@streamroot/videojs-hlsjs-plugin");
hlsPlugin.register(videojs);
At this point I can't get version 1.0.13 of the plugin to work.
Unrelated to the lack of functioning, but related to my reason for forking: Could the package on NPM be updated to include the full source code of the plugin, instead of just a minified and compiled mess? When including the plugin via a <script> tag, yes, it makes sense to have the whole bundle combined like that. However I can do my own minification after the fact, and if the original source were made available in the package then Webpack could de-duplicate dependencies between my code and yours (for instance, in a few places where I register HLS.js event listeners, I have to import HLS.js to access constants like Hls.Events.MANIFEST_LOADED).