Skip to content

Plugin is not added when using import #36

@nicu-chiciuc

Description

@nicu-chiciuc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions