bikegriffith / clappr-playback-rate-plugin

A plugin for the Clappr HTML5 video player that enables variable speed playback (0.5x, 1x, 2x, ...)
MIT License
37 stars 18 forks source link

Reference Error with latest clappr build #5

Closed nburt closed 7 years ago

nburt commented 7 years ago

I'm currently in the process of integrating Clappr and came across this plugin which we'd like to add.

I've installed version 0.2.0 with version 0.2.64 of Clappr with NPM and integrated the plugin into a React app following the docs.

The error I see on page load is: ReferenceError: external undefined plugin on core array

I searched around and saw an issue for another Clappr plugin from about a year back (https://github.com/clappr/clappr-level-selector-plugin/issues/7). Could a recent Clappr version have broken the plugin?

Please let me know if there's any other info I can provide. Thanks!

Nate

bikegriffith commented 7 years ago

@nburt Thanks for the report! Please give this recent change a try and if you're still having issues reopen this issue and let me know.

nburt commented 7 years ago

@bikegriffith Thanks for taking a look so quickly.

I still seem to be getting the same error message on v0.3.0. I put a breakpoint in validateExternalPluginsType within Clappr and I'm getting an empty object:

image

Maybe I'm importing incorrectly? I installed using npm and imported just as in the docs:

import Clappr from 'clappr';
import PlaybackRatePlugin from 'clappr-playback-rate-plugin';

We ended up having to rebuild the media controls from scratch for other reasons so I'm not sure we'll be using the playback plugin in the project anymore but I'll see if I can create a small repo to reproduce this week if it's working locally for you.

nburt commented 7 years ago

@bikegriffith I was just able to get this to work.

Switching from import PlaybackRatePlugin from 'clappr-playback-rate-plugin'; to import PlaybackRatePlugin from 'clappr-playback-rate-plugin/dist/clappr-playback-rate-plugin'; did the trick