Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble utilizing latest version #98

Open
stevendesu opened this issue Aug 27, 2019 · 2 comments
Open

Trouble utilizing latest version #98

stevendesu opened this issue Aug 27, 2019 · 2 comments

Comments

@stevendesu
Copy link

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 [email protected]: 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).

@tri170391
Copy link
Contributor

tri170391 commented Aug 27, 2019

#94

Probably caused by this, anyway since you forked anyway you can revert this change on your fork I guess.

About the full source code you can use NPM feature to add git dependency on a certain release tag or branch of any repo.

@tri170391
Copy link
Contributor

For some context our CI and delivery for this script is majorly as a web script and since umd export will not "activate" when client has amd on his page (require.js) it breaks our intended use case...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants