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

fix: make the plugin works again #17

Closed kslimani closed 4 years ago

kslimani commented 4 years ago

This PR restore the backward compatibility with Clappr 0.2.x and make it work again with latest.

Major changes :

kslimani commented 4 years ago

@bikegriffith i also added a new rateSuffix option (default to 'x') which is only used when unexpected rate value is set using setPlaybackRate external interface method.

For example :

var player = new Clappr.Player({/* [...] */});
player.setPlaybackRate(0.456) // will display "0.456x"

var player = new Clappr.Player({playbackRateConfig: {rateSuffix: ' times'},/* [...] */});
player.setPlaybackRate(0.456) // will display "0.456 times"