How to use the clappr.template function in clappr

To help you get started, we’ve selected a few clappr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bikegriffith / clappr-playback-rate-plugin / src / main.js View on Github external
render() {
    //console.log('PlaybackRatePlugin#render()');
    const cfg = this.core.options.playbackRateConfig || {};

    if (!this.playbackRates) {
      this.playbackRates = cfg.options || DEFAULT_PLAYBACK_RATES;
    }

    if (!this.selectedRate) {
      this.selectedRate = cfg.defaultValue || DEFAULT_PLAYBACK_RATE;
    }

    if (this.shouldRender()) {
      var t = template(pluginHtml);
      var html = t({playbackRates: this.playbackRates, title: this.getTitle()});
      this.$el.html(html);

      var style = Styler.getStyleFor(pluginStyle, {baseUrl: this.core.options.baseUrl});
      this.$el.append(style);

      this.core.mediaControl.$('.media-control-right-panel').append(this.el);
      this.updateText();
    }

    return this;
  }
github Paratii-Video / paratii-mediaplayer / src / js / controls.js View on Github external
get template() {
    return Clappr.template(MediaControl);
  }