clappr-playback-rate-plugin icon indicating copy to clipboard operation
clappr-playback-rate-plugin copied to clipboard

PlaybackRatePlugin is not defined

Open navjotss opened this issue 6 years ago • 3 comments

Tried Both way to call the plugin. But getting the same error every time.

plugins: {
             'core' : [PlaybackRatePlugin]
	},
plugins: {
             core : [PlaybackRatePlugin]
	},

Uncaught ReferenceError: PlaybackRatePlugin is not defined at window.onload ((index):32).

After that i take code and compile it on my local machine. Files are generated, but getting the same error.

navjotss avatar Mar 14 '18 07:03 navjotss

It looks like the instructions for using this outside of an ES6 module are incomplete. I'm assuming you're not using webpack or any other ES6 bundler, correct?

The workaround would be to do the following:

<script src="https://cdnjs.cloudflare.com/ajax/libs/clappr/0.2.87/clappr.min.js"></script>
<script>window.clappr = Clappr</script>
<script src="lib/lib/clappr-playback-rate-plugin.min.js"></script>
<script>window.PlaybackRatePlugin = window['clappr-playback-rate-plugin'].default</script>
<script>
    // initialize player as before...
</script>

bikegriffith avatar Mar 14 '18 15:03 bikegriffith

Also see #8

bikegriffith avatar Mar 14 '18 15:03 bikegriffith

Its because i didn't add this in code.

Now its working fine. Thanks @bikegriffith for your instant help.

navjotss avatar Mar 15 '18 09:03 navjotss