Releases: clappr/clappr-core
0.4.4
- Change bundle tool from webpack to rollup
0.4.3
0.4.2
0.4.1
0.4.0
This release has some important breaking changes, mostly related to the deprecation of components. If a given plugin is not compatible with the included changes, it should be updated or the previous version should be used.
List of changes
This version includes the following changes:
-
The
Loader
now won't include built-in plugins/playbacks hardcoded by default. It now allows registering new plugins to be loaded for all player instances, instead of having to add those to theplugins
list for each player instantiation.To allow registering plugins/playbacks, the
Loader
now has some static methods to register/unregister plugins/playbacks and to query what plugins and playbacks are currently registered in it.So, for example, if one wants to register the shaka playback, the only thing to do is to call
Loader.registerPlayback(DashShakaPlayback)
before instantiating the player.
The other way, passing the
plugins
array as an option is still supported:const player = new Clappr.Player({ //... plugins: [DashShakaPlayback], })
-
Plugins are now required to declare their version support, through the
supportedVersion
property. If this property is missing, empty or is falsy, a warning message will be displayed and the plugin will not load.The
supportedVersion
must be a range-like object with a mandatorymin
version and an optionalmax
version. If themax
version is omitted, the next minor version will be set as the upper limit (exclusive). Themin
andmax
versions should be integers (for major versions only) or strings representing a semver-based version (for example'0.4.0'
)So, for a plugin to load in this new version, it must follow the format:
class Plugin extends CorePlugin { get supportedVersion{ return { min: '0.4.0' } } //... }
-
The
Mediator
andPlayerInfo
global objects are no longer supported. Plugins and Playbacks that need to access information from PlayerInfo should only rely on information available on their contexts, likeContainer
orCore
.As for the
Mediator
, objects that make use of it to send events across contexts should rework their event model to use their context instead.Both objects are reminiscent of the Flash era transition, where some objects needed access to some player contexts from some global JavaScript scope which was called from the Flash JavaScript interface. This is no longer necessary and long due for removal.