Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/mediaplayer/ |
Upload File : |
;(function() { "use strict"; BX.namespace("BX.Landing.MediaPlayer"); const getQueryParameters = BX.Landing.Utils.getQueryParams; const isFunction = BX.Landing.Utils.isFunction; /** * Implements base base interface * @param {HTMLIFrameElement} iframe * @param {Object} additionalParameters - additional params for player * @constructor */ BX.Landing.MediaPlayer.BasePlayer = function(iframe, additionalParameters) { this.iframe = iframe; this.parameters = getQueryParameters(iframe.src); Object.assign(this.parameters, additionalParameters); Object.keys(this.parameters).forEach(function(key) { if (!isNaN(parseFloat(this.parameters[key]))) { this.parameters[key] = parseFloat(this.parameters[key]); } }, this); this.onPlayerReady = isFunction(additionalParameters.onPlayerReadyHandler) ? additionalParameters.onPlayerReadyHandler : () => {} ; }; BX.Landing.MediaPlayer.BasePlayer.prototype = { /** * Starts playback * @abstract */ play: function() { throw new Error("Must be implemented by subclass"); }, /** * Stops playback * @abstract */ pause: function() { throw new Error("Must be implemented by subclass"); }, /** * Stops video */ stop: function() { throw new Error("Must be implemented by subclass"); }, /** * Sets loop playback * @abstract * @param {Boolean} value */ setLoop: function(value) { throw new Error("Must be implemented by subclass"); }, /** * Sets start video * @abstract * @param seconds */ seekTo: function(seconds) { throw new Error("Must be implemented by subclass"); }, /** * Disables sound * @abstract */ mute: function() { throw new Error("Must be implemented by subclass"); }, /** * Enables sound * @abstract */ unMute: function() { throw new Error("Must be implemented by subclass"); } }; })();