Skip to content

Releases: clappr/clappr-core

0.4.4

01 Jun 01:19
Compare
Choose a tag to compare
  • Change bundle tool from webpack to rollup

0.4.3

01 Jun 01:15
Compare
Choose a tag to compare

0.4.2

01 Jun 01:11
Compare
Choose a tag to compare
  • 19e9499 New CONTAINER_RESIZE event

0.4.1

01 Jun 01:04
Compare
Choose a tag to compare
  • 47e11ff Log a warning message when loading plugins without version information from option

0.4.0

15 Oct 22:33
Compare
Choose a tag to compare

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 the plugins 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 mandatory min version and an optional max version. If the max version is omitted, the next minor version will be set as the upper limit (exclusive). The min and max 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 and PlayerInfo 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, like Container or Core.

    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.