How to use the clappr.Styler.getStyleFor 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 tjenkinson / clappr-thumbnails-plugin / src / index.js View on Github external
_createElements() {
    this.$el.html(this.template({'backdropHeight':this._getOptions().backdropHeight, 'spotlightHeight':this._getOptions().spotlightHeight}))
    this.$el.append(Styler.getStyleFor(pluginStyle))
    // cache dom references
    this._$spotlight = this.$el.find(".spotlight")
    this._$backdrop = this.$el.find(".backdrop")
    this._$carousel = this._$backdrop.find(".carousel")
    this.$el.addClass("hidden")
    this._appendElToMediaControl()
  }
}
github kslimani / clappr-google-ima-html5-preroll / src / index.js View on Github external
render() {
    this._remove()
    this._$adContainer = $("<div>").addClass("preroll-container").attr('data-preroll', '')
    this._$clickOverlay = $("<div>").addClass("preroll-overlay").attr('data-preroll', '')
    this.$el.append(this._$adContainer)
    this.$el.append(this._$clickOverlay)
    this.$el.append(Styler.getStyleFor(pluginStyle))
    this._adContainer = this._$adContainer[0]
    this._clickOverlay = this._$clickOverlay[0]

    return this
  }
</div></div>
github bikegriffith / clappr-playback-rate-plugin / src / main.js View on Github external
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;
  }