videojs-offset icon indicating copy to clipboard operation
videojs-offset copied to clipboard

Plugin is not added when using `import`

Open nicu-chiciuc opened this issue 7 years ago • 1 comments

Description

When using imports, the plugin is not registered on video.js

Steps to reproduce

  1. Create a new project with create-react-app.
  2. Add video.js and video.js-offsest
  3. In a VideoPlayer component (https://docs.videojs.com/tutorial-react.html) add this at the top:
import React from "react";
import videojs from "video.js";
import "videojs-offset";

Results

Expected

The plugin should work ok.

Error output

TypeError: this.offset is not a function

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

^7.3.0

I could make this work by registering the plugin manually:

import offset from "videojs-offset";

videojs.registerPlugin("offset", offset);

I've also tried to select a video.js version that corresponds with the one in videojs-offset package.json. I think what happens is that the plugin is registered for its own version of video.js.

nicu-chiciuc avatar Dec 04 '18 10:12 nicu-chiciuc

Hi @nicu-chiciuc, yeah I'm experiencing this issue as well in my projects and it is probably related to this issue as well #38.

I don't have a fix for that but I'm investigating.

cladera avatar Feb 08 '19 12:02 cladera