Sha256: aab9f286bf7709be4a43170be9df1b13b83cbf7d8ff9bf3df5c080c7cf759608
Contents?: true
Size: 1.33 KB
Versions: 54
Compression:
Stored size: 1.33 KB
Contents
/** * Video and audio wrapper. * * @author Htmlstream * @version 1.0 * @requires * */ ;(function ($) { 'use strict'; $.HSCore.components.HSVideoAudio = { /** * * * @var Object _baseConfig */ _baseConfig: {}, /** * * * @var jQuery pageCollection */ pageCollection: $(), /** * Initialization of Video and audio wrapper. * * @param String selector (optional) * @param Object config (optional) * * @return jQuery pageCollection - collection of initialized items. */ init: function (selector, config) { this.collection = selector && $(selector).length ? $(selector) : $(); if (!$(selector).length) return; this.config = config && $.isPlainObject(config) ? $.extend({}, this._baseConfig, config) : this._baseConfig; this.config.itemSelector = selector; this.initVideoAudio(); return this.pageCollection; }, initVideoAudio: function () { //Variables var $self = this, collection = $self.pageCollection; //Actions this.collection.each(function (i, el) { //Variables var $videoAudio = el; plyr.setup($videoAudio); //Add object to collection collection = collection.add($videoAudio); }); } } })(jQuery);
Version data entries
54 entries across 54 versions & 1 rubygems