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ClB,OApCI,GACF,OAAO,oBAAoB,GAAW,SAAQ,SAAU,GACtD,GAAmB,EAAM,IAAM,EAAU,GAAO,OAClD,IAIF,EAAS,aAAa,CACpB,MAAO,EACP,UAAW,EAEX,kBAAmB,SAEnB,gBAAiB,OAChB,GAGH,OAAO,oBAAoB,GAAQ,SAAQ,SAAU,GACnD,GAAgB,gBAAkB,EAAM,YAAc,EAAO,GAAO,MACtE,IAEA,EAAa,aAAa,CAExB,KAAM,EAGN,MAAO,OACP,OAAQ,QAEP,GAGH,OAAO,oBAAoB,GAAY,SAAQ,SAAU,GACvD,GAAe,EAAM,KAAO,EAAW,GAAO,IAChD,IAxCa,gDA0CQ,EAAc,IAAM,EAAe,WAC1D,EAGA,mBAAmB,OAEf,KAAK,QAAQ,UACf,QAAQ,IAAI,KAAK,kEACjB,QAAQ,IAAI,KAAK,gEAEjB,QAAQ,aAAa,QAAS,OAGhC,MAAM,QAAU,QAEhB,OAAO,QAAU","file":"/npm/videojs-flash@2.2.1/dist/videojs-flash.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/videojs-flash@2.2.1/dist/videojs-flash.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar videojs = _interopDefault(require('video.js'));\nvar package_json = require('videojs-swf/package.json');\nvar window = _interopDefault(require('global/window'));\n\nvar version = \"2.2.1\";\n\n/**\n * @file flash-rtmp.js\n * @module flash-rtmp\n */\n\n/**\n * Add RTMP properties to the {@link Flash} Tech.\n *\n * @param {Flash} Flash\n *        The flash tech class.\n *\n * @mixin FlashRtmpDecorator\n *\n * @return {Flash}\n *         The flash tech with RTMP properties added.\n */\nfunction FlashRtmpDecorator(Flash) {\n  Flash.streamingFormats = {\n    'rtmp/mp4': 'MP4',\n    'rtmp/flv': 'FLV'\n  };\n\n  /**\n   * Join connection and stream with an ampersand.\n   *\n   * @param {string} connection\n   *        The connection string.\n   *\n   * @param {string} stream\n   *        The stream string.\n   *\n   * @return {string}\n   *         The connection and stream joined with an `&` character\n   */\n  Flash.streamFromParts = function (connection, stream) {\n    return connection + '&' + stream;\n  };\n\n  /**\n   * The flash parts object that contains connection and stream info.\n   *\n   * @typedef {Object} Flash~PartsObject\n   *\n   * @property {string} connection\n   *           The connection string of a source, defaults to an empty string.\n   *\n   * @property {string} stream\n   *           The stream string of the source, defaults to an empty string.\n   */\n\n  /**\n   * Convert a source url into a stream and connection parts.\n   *\n   * @param {string} src\n   *        the source url\n   *\n   * @return {Flash~PartsObject}\n   *         The parts object that contains a connection and a stream\n   */\n  Flash.streamToParts = function (src) {\n    var parts = {\n      connection: '',\n      stream: ''\n    };\n\n    if (!src) {\n      return parts;\n    }\n\n    // Look for the normal URL separator we expect, '&'.\n    // If found, we split the URL into two pieces around the\n    // first '&'.\n    var connEnd = src.search(/&(?![\\w-]+=)/);\n    var streamBegin = void 0;\n\n    if (connEnd !== -1) {\n      streamBegin = connEnd + 1;\n    } else {\n      // If there's not a '&', we use the last '/' as the delimiter.\n      connEnd = streamBegin = src.lastIndexOf('/') + 1;\n      if (connEnd === 0) {\n        // really, there's not a '/'?\n        connEnd = streamBegin = src.length;\n      }\n    }\n\n    parts.connection = src.substring(0, connEnd);\n    parts.stream = src.substring(streamBegin, src.length);\n\n    return parts;\n  };\n\n  /**\n   * Check if the source type is a streaming type.\n   *\n   * @param {string} srcType\n   *        The mime type to check.\n   *\n   * @return {boolean}\n   *          - True if the source type is a streaming type.\n   *          - False if the source type is not a streaming type.\n   */\n  Flash.isStreamingType = function (srcType) {\n    return srcType in Flash.streamingFormats;\n  };\n\n  // RTMP has four variations, any string starting\n  // with one of these protocols should be valid\n\n  /**\n   * Regular expression used to check if the source is an rtmp source.\n   *\n   * @property {RegExp} Flash.RTMP_RE\n   */\n  Flash.RTMP_RE = /^rtmp[set]?:\\/\\//i;\n\n  /**\n   * Check if the source itself is a streaming type.\n   *\n   * @param {string} src\n   *        The url to the source.\n   *\n   * @return {boolean}\n   *          - True if the source url indicates that the source is streaming.\n   *          - False if the shource url indicates that the source url is not streaming.\n   */\n  Flash.isStreamingSrc = function (src) {\n    return Flash.RTMP_RE.test(src);\n  };\n\n  /**\n   * A source handler for RTMP urls\n   * @type {Object}\n   */\n  Flash.rtmpSourceHandler = {};\n\n  /**\n   * Check if Flash can play the given mime type.\n   *\n   * @param {string} type\n   *        The mime type to check\n   *\n   * @return {string}\n   *         'maybe', or '' (empty string)\n   */\n  Flash.rtmpSourceHandler.canPlayType = function (type) {\n    if (Flash.isStreamingType(type)) {\n      return 'maybe';\n    }\n\n    return '';\n  };\n\n  /**\n   * Check if Flash can handle the source natively\n   *\n   * @param {Object} source\n   *        The source object\n   *\n   * @param {Object} [options]\n   *        The options passed to the tech\n   *\n   * @return {string}\n   *         'maybe', or '' (empty string)\n   */\n  Flash.rtmpSourceHandler.canHandleSource = function (source, options) {\n    var can = Flash.rtmpSourceHandler.canPlayType(source.type);\n\n    if (can) {\n      return can;\n    }\n\n    if (Flash.isStreamingSrc(source.src)) {\n      return 'maybe';\n    }\n\n    return '';\n  };\n\n  /**\n   * Pass the source to the flash object.\n   *\n   * @param {Object} source\n   *        The source object\n   *\n   * @param {Flash} tech\n   *        The instance of the Flash tech\n   *\n   * @param {Object} [options]\n   *        The options to pass to the source\n   */\n  Flash.rtmpSourceHandler.handleSource = function (source, tech, options) {\n    var srcParts = Flash.streamToParts(source.src);\n\n    tech.setRtmpConnection(srcParts.connection);\n    tech.setRtmpStream(srcParts.stream);\n  };\n\n  // Register the native source handler\n  Flash.registerSourceHandler(Flash.rtmpSourceHandler);\n\n  return Flash;\n}\n\nvar classCallCheck = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError(\"Cannot call a class as a function\");\n  }\n};\n\nvar inherits = function (subClass, superClass) {\n  if (typeof superClass !== \"function\" && superClass !== null) {\n    throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n  }\n\n  subClass.prototype = Object.create(superClass && superClass.prototype, {\n    constructor: {\n      value: subClass,\n      enumerable: false,\n      writable: true,\n      configurable: true\n    }\n  });\n  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n  if (!self) {\n    throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n  }\n\n  return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * @file flash.js\n * VideoJS-SWF - Custom Flash Player with HTML5-ish API\n * https://github.com/zencoder/video-js-swf\n * Not using setupTriggers. Using global onEvent func to distribute events\n */\n\nvar Tech = videojs.getComponent('Tech');\nvar Dom = videojs.dom;\nvar Url = videojs.url;\nvar createTimeRange = videojs.createTimeRange;\nvar mergeOptions = videojs.mergeOptions;\n\nvar navigator = window && window.navigator || {};\n\n/**\n * Flash Media Controller - Wrapper for Flash Media API\n *\n * @mixes FlashRtmpDecorator\n * @mixes Tech~SouceHandlerAdditions\n * @extends Tech\n */\n\nvar Flash = function (_Tech) {\n  inherits(Flash, _Tech);\n\n  /**\n  * Create an instance of this Tech.\n  *\n  * @param {Object} [options]\n  *        The key/value store of player options.\n  *\n  * @param {Component~ReadyCallback} ready\n  *        Callback function to call when the `Flash` Tech is ready.\n  */\n  function Flash(options, ready) {\n    classCallCheck(this, Flash);\n\n    // Set the source when ready\n    var _this = possibleConstructorReturn(this, _Tech.call(this, options, ready));\n\n    if (options.source) {\n      _this.ready(function () {\n        this.setSource(options.source);\n      }, true);\n    }\n\n    // Having issues with Flash reloading on certain page actions\n    // (hide/resize/fullscreen) in certain browsers\n    // This allows resetting the playhead when we catch the reload\n    if (options.startTime) {\n      _this.ready(function () {\n        this.load();\n        this.play();\n        this.currentTime(options.startTime);\n      }, true);\n    }\n\n    // Add global window functions that the swf expects\n    // A 4.x workflow we weren't able to solve for in 5.0\n    // because of the need to hard code these functions\n    // into the swf for security reasons\n    window.videojs = window.videojs || {};\n    window.videojs.Flash = window.videojs.Flash || {};\n    window.videojs.Flash.onReady = Flash.onReady;\n    window.videojs.Flash.onEvent = Flash.onEvent;\n    window.videojs.Flash.onError = Flash.onError;\n\n    _this.on('seeked', function () {\n      this.lastSeekTarget_ = undefined;\n    });\n\n    return _this;\n  }\n\n  /**\n   * Create the `Flash` Tech's DOM element.\n   *\n   * @return {Element}\n   *         The element that gets created.\n   */\n\n\n  Flash.prototype.createEl = function createEl() {\n    var options = this.options_;\n\n    // If video.js is hosted locally you should also set the location\n    // for the hosted swf, which should be relative to the page (not video.js)\n    // Otherwise this adds a CDN url.\n    // The CDN also auto-adds a swf URL for that specific version.\n    if (!options.swf) {\n      options.swf = 'https://vjs.zencdn.net/swf/' + package_json.version + '/video-js.swf';\n    }\n\n    // Generate ID for swf object\n    var objId = options.techId;\n\n    // Merge default flashvars with ones passed in to init\n    var flashVars = mergeOptions({\n\n      // SWF Callback Functions\n      readyFunction: 'videojs.Flash.onReady',\n      eventProxyFunction: 'videojs.Flash.onEvent',\n      errorEventProxyFunction: 'videojs.Flash.onError',\n\n      // Player Settings\n      autoplay: options.autoplay,\n      preload: options.preload,\n      loop: options.loop,\n      muted: options.muted\n\n    }, options.flashVars);\n\n    // Merge default parames with ones passed in\n    var params = mergeOptions({\n      // Opaque is needed to overlay controls, but can affect playback performance\n      wmode: 'opaque',\n      // Using bgcolor prevents a white flash when the object is loading\n      bgcolor: '#000000'\n    }, options.params);\n\n    // Merge default attributes with ones passed in\n    var attributes = mergeOptions({\n      // Both ID and Name needed or swf to identify itself\n      id: objId,\n      name: objId,\n      'class': 'vjs-tech'\n    }, options.attributes);\n\n    this.el_ = Flash.embed(options.swf, flashVars, params, attributes);\n    this.el_.tech = this;\n\n    return this.el_;\n  };\n\n  /**\n   * Called by {@link Player#play} to play using the `Flash` `Tech`.\n   */\n\n\n  Flash.prototype.play = function play() {\n    if (this.ended()) {\n      this.setCurrentTime(0);\n    }\n    this.el_.vjs_play();\n  };\n\n  /**\n   * Called by {@link Player#pause} to pause using the `Flash` `Tech`.\n   */\n\n\n  Flash.prototype.pause = function pause() {\n    this.el_.vjs_pause();\n  };\n\n  /**\n   * A getter/setter for the `Flash` Tech's source object.\n   * > Note: Please use {@link Flash#setSource}\n   *\n   * @param {Tech~SourceObject} [src]\n   *        The source object you want to set on the `Flash` techs.\n   *\n   * @return {Tech~SourceObject|undefined}\n   *         - The current source object when a source is not passed in.\n   *         - undefined when setting\n   *\n   * @deprecated Since version 5.\n   */\n\n\n  Flash.prototype.src = function src(_src) {\n    if (_src === undefined) {\n      return this.currentSrc();\n    }\n\n    // Setting src through `src` not `setSrc` will be deprecated\n    return this.setSrc(_src);\n  };\n\n  /**\n   * A getter/setter for the `Flash` Tech's source object.\n   *\n   * @param {Tech~SourceObject} [src]\n   *        The source object you want to set on the `Flash` techs.\n   */\n\n\n  Flash.prototype.setSrc = function setSrc(src) {\n    var _this2 = this;\n\n    // Make sure source URL is absolute.\n    src = Url.getAbsoluteURL(src);\n    this.el_.vjs_src(src);\n\n    // Currently the SWF doesn't autoplay if you load a source later.\n    // e.g. Load player w/ no source, wait 2s, set src.\n    if (this.autoplay()) {\n      this.setTimeout(function () {\n        return _this2.play();\n      }, 0);\n    }\n  };\n\n  /**\n   * Indicates whether the media is currently seeking to a new position or not.\n   *\n   * @return {boolean}\n   *         - True if seeking to a new position\n   *         - False otherwise\n   */\n\n\n  Flash.prototype.seeking = function seeking() {\n    return this.lastSeekTarget_ !== undefined;\n  };\n\n  /**\n   * Returns the current time in seconds that the media is at in playback.\n   *\n   * @param {number} time\n   *        Current playtime of the media in seconds.\n   */\n\n\n  Flash.prototype.setCurrentTime = function setCurrentTime(time) {\n    var seekable = this.seekable();\n\n    if (seekable.length) {\n      // clamp to the current seekable range\n      time = time > seekable.start(0) ? time : seekable.start(0);\n      time = time < seekable.end(seekable.length - 1) ? time : seekable.end(seekable.length - 1);\n\n      this.lastSeekTarget_ = time;\n      this.trigger('seeking');\n      this.el_.vjs_setProperty('currentTime', time);\n      _Tech.prototype.setCurrentTime.call(this);\n    }\n  };\n\n  /**\n   * Get the current playback time in seconds\n   *\n   * @return {number}\n   *         The current time of playback in seconds.\n   */\n\n\n  Flash.prototype.currentTime = function currentTime() {\n    // when seeking make the reported time keep up with the requested time\n    // by reading the time we're seeking to\n    if (this.seeking()) {\n      return this.lastSeekTarget_ || 0;\n    }\n    return this.el_.vjs_getProperty('currentTime');\n  };\n\n  /**\n   * Get the current source\n   *\n   * @method currentSrc\n   * @return {Tech~SourceObject}\n   *         The current source\n   */\n\n\n  Flash.prototype.currentSrc = function currentSrc() {\n    if (this.currentSource_) {\n      return this.currentSource_.src;\n    }\n    return this.el_.vjs_getProperty('currentSrc');\n  };\n\n  /**\n   * Get the total duration of the current media.\n   *\n   * @return {number}\n   8          The total duration of the current media.\n   */\n\n\n  Flash.prototype.duration = function duration() {\n    if (this.readyState() === 0) {\n      return NaN;\n    }\n    var duration = this.el_.vjs_getProperty('duration');\n\n    return duration >= 0 ? duration : Infinity;\n  };\n\n  /**\n   * Load media into Tech.\n   */\n\n\n  Flash.prototype.load = function load() {\n    this.el_.vjs_load();\n  };\n\n  /**\n   * Get the poster image that was set on the tech.\n   */\n\n\n  Flash.prototype.poster = function poster() {\n    this.el_.vjs_getProperty('poster');\n  };\n\n  /**\n   * Poster images are not handled by the Flash tech so make this is a no-op.\n   */\n\n\n  Flash.prototype.setPoster = function setPoster() {};\n\n  /**\n   * Determine the time ranges that can be seeked to in the media.\n   *\n   * @return {TimeRange}\n   *         Returns the time ranges that can be seeked to.\n   */\n\n\n  Flash.prototype.seekable = function seekable() {\n    var duration = this.duration();\n\n    if (duration === 0) {\n      return createTimeRange();\n    }\n    return createTimeRange(0, duration);\n  };\n\n  /**\n   * Get and create a `TimeRange` object for buffering.\n   *\n   * @return {TimeRange}\n   *         The time range object that was created.\n   */\n\n\n  Flash.prototype.buffered = function buffered() {\n    var ranges = this.el_.vjs_getProperty('buffered');\n\n    if (ranges.length === 0) {\n      return createTimeRange();\n    }\n    return createTimeRange(ranges[0][0], ranges[0][1]);\n  };\n\n  /**\n   * Get fullscreen support -\n   *\n   * Flash does not allow fullscreen through javascript\n   * so this always returns false.\n   *\n   * @return {boolean}\n   *         The Flash tech does not support fullscreen, so it will always return false.\n   */\n\n\n  Flash.prototype.supportsFullScreen = function supportsFullScreen() {\n    // Flash does not allow fullscreen through javascript\n    return false;\n  };\n\n  /**\n   * Flash does not allow fullscreen through javascript\n   * so this always returns false.\n   *\n   * @return {boolean}\n   *         The Flash tech does not support fullscreen, so it will always return false.\n   */\n\n\n  Flash.prototype.enterFullScreen = function enterFullScreen() {\n    return false;\n  };\n\n  /**\n   * Gets available media playback quality metrics as specified by the W3C's Media\n   * Playback Quality API.\n   *\n   * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n   *\n   * @return {Object}\n   *         An object with supported media playback quality metrics\n   */\n\n\n  Flash.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n    var videoPlaybackQuality = this.el_.vjs_getProperty('getVideoPlaybackQuality');\n\n    if (window.performance && typeof window.performance.now === 'function') {\n      videoPlaybackQuality.creationTime = window.performance.now();\n    } else if (window.performance && window.performance.timing && typeof window.performance.timing.navigationStart === 'number') {\n      videoPlaybackQuality.creationTime = window.Date.now() - window.performance.timing.navigationStart;\n    }\n\n    return videoPlaybackQuality;\n  };\n\n  return Flash;\n}(Tech);\n\n// Create setters and getters for attributes\n\n\nvar _readWrite = ['rtmpConnection', 'rtmpStream', 'preload', 'defaultPlaybackRate', 'playbackRate', 'autoplay', 'loop', 'controls', 'volume', 'muted', 'defaultMuted'];\nvar _readOnly = ['networkState', 'readyState', 'initialTime', 'startOffsetTime', 'paused', 'ended', 'videoWidth', 'videoHeight'];\nvar _api = Flash.prototype;\n\n/**\n * Create setters for the swf on the element\n *\n * @param {string} attr\n *        The name of the parameter\n *\n * @private\n */\nfunction _createSetter(attr) {\n  var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1);\n\n  _api['set' + attrUpper] = function (val) {\n    return this.el_.vjs_setProperty(attr, val);\n  };\n}\n\n/**\n * Create getters for the swf on the element\n *\n * @param {string} attr\n *        The name of the parameter\n *\n * @private\n */\nfunction _createGetter(attr) {\n  _api[attr] = function () {\n    return this.el_.vjs_getProperty(attr);\n  };\n}\n\n// Create getter and setters for all read/write attributes\nfor (var i = 0; i < _readWrite.length; i++) {\n  _createGetter(_readWrite[i]);\n  _createSetter(_readWrite[i]);\n}\n\n// Create getters for read-only attributes\nfor (var _i = 0; _i < _readOnly.length; _i++) {\n  _createGetter(_readOnly[_i]);\n}\n\n/** ------------------------------ Getters ------------------------------ **/\n/**\n * Get the value of `rtmpConnection` from the swf.\n *\n * @method Flash#rtmpConnection\n * @return {string}\n *         The current value of `rtmpConnection` on the swf.\n */\n\n/**\n * Get the value of `rtmpStream` from the swf.\n *\n * @method Flash#rtmpStream\n * @return {string}\n *         The current value of `rtmpStream` on the swf.\n */\n\n/**\n * Get the value of `preload` from the swf. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n *   media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n *    interaction\n *\n * @method Flash#preload\n * @return {string}\n *         The value of `preload` from the swf. Will be 'none', 'metadata',\n *         or 'auto'.\n */\n\n/**\n * Get the value of `defaultPlaybackRate` from the swf.\n *\n * @method Flash#defaultPlaybackRate\n * @return {number}\n *         The current value of `defaultPlaybackRate` on the swf.\n */\n\n/**\n * Get the value of `playbackRate` from the swf. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n *   - if playbackRate is set to 2, media will play twice as fast.\n *   - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Flash#playbackRate\n * @return {number}\n *         The value of `playbackRate` from the swf. A number indicating\n *         the current playback speed of the media, where 1 is normal speed.\n */\n\n/**\n * Get the value of `autoplay` from the swf. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Flash#autoplay\n * @return {boolean}\n *         - The value of `autoplay` from the swf.\n *         - True indicates that the media ashould start as soon as the page loads.\n *         - False indicates that the media should not start as soon as the page loads.\n */\n\n/**\n * Get the value of `loop` from the swf. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Flash#loop\n * @return {boolean}\n *         - The value of `loop` from the swf.\n *         - True indicates that playback should seek back to start once\n *           the end of a media is reached.\n *         - False indicates that playback should not loop back to the start when the\n *           end of the media is reached.\n */\n\n/**\n * Get the value of `mediaGroup` from the swf.\n *\n * @method Flash#mediaGroup\n * @return {string}\n *         The current value of `mediaGroup` on the swf.\n */\n\n/**\n * Get the value of `controller` from the swf.\n *\n * @method Flash#controller\n * @return {string}\n *         The current value of `controller` on the swf.\n */\n\n/**\n * Get the value of `controls` from the swf. `controls` indicates\n * whether the native flash controls should be shown or hidden.\n *\n * @method Flash#controls\n * @return {boolean}\n *         - The value of `controls` from the swf.\n *         - True indicates that native controls should be showing.\n *         - False indicates that native controls should be hidden.\n */\n\n/**\n * Get the value of the `volume` from the swf. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Flash#volume\n * @return {number}\n *         The volume percent as a decimal. Value will be between 0-1.\n */\n\n/**\n * Get the value of the `muted` from the swf. `muted` indicates the current\n * audio level should be silent.\n *\n * @method Flash#muted\n * @return {boolean}\n *         - True if the audio should be set to silent\n *         - False otherwise\n */\n\n/**\n * Get the value of `defaultMuted` from the swf. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. `muted` indicates the\n * current state.\n *\n * @method Flash#defaultMuted\n * @return {boolean}\n *         - The value of `defaultMuted` from the swf.\n *         - True indicates that the media should start muted.\n *         - False indicates that the media should not start muted.\n */\n\n/**\n * Get the value of `networkState` from the swf. `networkState` indicates\n * the current network state. It returns an enumeration from the following list:\n * - 0: NETWORK_EMPTY\n * - 1: NEWORK_IDLE\n * - 2: NETWORK_LOADING\n * - 3: NETWORK_NO_SOURCE\n *\n * @method Flash#networkState\n * @return {number}\n *         The value of `networkState` from the swf. This will be a number\n *         from the list in the description.\n */\n\n/**\n * Get the value of `readyState` from the swf. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Flash#readyState\n * @return {number}\n *         The value of `readyState` from the swf. This will be a number\n *         from the list in the description.\n */\n\n/**\n * Get the value of `readyState` from the swf. `readyState` indicates\n * the current state of the media element. It returns an enumeration from the\n * following list:\n * - 0: HAVE_NOTHING\n * - 1: HAVE_METADATA\n * - 2: HAVE_CURRENT_DATA\n * - 3: HAVE_FUTURE_DATA\n * - 4: HAVE_ENOUGH_DATA\n *\n * @method Flash#readyState\n * @return {number}\n *         The value of `readyState` from the swf. This will be a number\n *         from the list in the description.\n */\n\n/**\n * Get the value of `initialTime` from the swf.\n *\n * @method Flash#initialTime\n * @return {number}\n *         The `initialTime` proprety on the swf.\n */\n\n/**\n * Get the value of `startOffsetTime` from the swf.\n *\n * @method Flash#startOffsetTime\n * @return {number}\n *         The `startOffsetTime` proprety on the swf.\n */\n\n/**\n * Get the value of `paused` from the swf. `paused` indicates whether the swf\n * is current paused or not.\n *\n * @method Flash#paused\n * @return {boolean}\n *         The value of `paused` from the swf.\n */\n\n/**\n * Get the value of `ended` from the swf. `ended` indicates whether\n * the media has reached the end or not.\n *\n * @method Flash#ended\n * @return {boolean}\n *         - True indicates that the media has ended.\n *         - False indicates that the media has not ended.\n *\n * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended}\n */\n\n/**\n * Get the value of `videoWidth` from the swf. `videoWidth` indicates\n * the current width of the media in css pixels.\n *\n * @method Flash#videoWidth\n * @return {number}\n *         The value of `videoWidth` from the swf. This will be a number\n *         in css pixels.\n */\n\n/**\n * Get the value of `videoHeight` from the swf. `videoHeigth` indicates\n * the current height of the media in css pixels.\n *\n * @method Flassh.prototype.videoHeight\n * @return {number}\n *         The value of `videoHeight` from the swf. This will be a number\n *         in css pixels.\n */\n/** ------------------------------ Setters ------------------------------ **/\n\n/**\n * Set the value of `rtmpConnection` on the swf.\n *\n * @method Flash#setRtmpConnection\n * @param {string} rtmpConnection\n *        New value to set the `rtmpConnection` property to.\n */\n\n/**\n * Set the value of `rtmpStream` on the swf.\n *\n * @method Flash#setRtmpStream\n * @param {string} rtmpStream\n *        New value to set the `rtmpStream` property to.\n */\n\n/**\n * Set the value of `preload` on the swf. `preload` indicates\n * what should download before the media is interacted with. It can have the following\n * values:\n * - none: nothing should be downloaded\n * - metadata: poster and the first few frames of the media may be downloaded to get\n *   media dimensions and other metadata\n * - auto: allow the media and metadata for the media to be downloaded before\n *    interaction\n *\n * @method Flash#setPreload\n * @param {string} preload\n *        The value of `preload` to set on the swf. Should be 'none', 'metadata',\n *        or 'auto'.\n */\n\n/**\n * Set the value of `defaultPlaybackRate` on the swf.\n *\n * @method Flash#setDefaultPlaybackRate\n * @param {number} defaultPlaybackRate\n *        New value to set the `defaultPlaybackRate` property to.\n */\n\n/**\n * Set the value of `playbackRate` on the swf. `playbackRate` indicates\n * the rate at which the media is currently playing back. Examples:\n *   - if playbackRate is set to 2, media will play twice as fast.\n *   - if playbackRate is set to 0.5, media will play half as fast.\n *\n * @method Flash#setPlaybackRate\n * @param {number} playbackRate\n *        New value of `playbackRate` on the swf. A number indicating\n *        the current playback speed of the media, where 1 is normal speed.\n */\n\n/**\n * Set the value of `autoplay` on the swf. `autoplay` indicates\n * that the media should start to play as soon as the page is ready.\n *\n * @method Flash#setAutoplay\n * @param {boolean} autoplay\n *        - The value of `autoplay` from the swf.\n *        - True indicates that the media ashould start as soon as the page loads.\n *        - False indicates that the media should not start as soon as the page loads.\n */\n\n/**\n * Set the value of `loop` on the swf. `loop` indicates\n * that the media should return to the start of the media and continue playing once\n * it reaches the end.\n *\n * @method Flash#setLoop\n * @param {boolean} loop\n *        - True indicates that playback should seek back to start once\n *          the end of a media is reached.\n *        - False indicates that playback should not loop back to the start when the\n *          end of the media is reached.\n */\n\n/**\n * Set the value of `mediaGroup` on the swf.\n *\n * @method Flash#setMediaGroup\n * @param {string} mediaGroup\n *        New value of `mediaGroup` to set on the swf.\n */\n\n/**\n * Set the value of `controller` on the swf.\n *\n * @method Flash#setController\n * @param {string} controller\n *        New value the current value of `controller` on the swf.\n */\n\n/**\n * Get the value of `controls` from the swf. `controls` indicates\n * whether the native flash controls should be shown or hidden.\n *\n * @method Flash#controls\n * @return {boolean}\n *         - The value of `controls` from the swf.\n *         - True indicates that native controls should be showing.\n *         - False indicates that native controls should be hidden.\n */\n\n/**\n * Set the value of the `volume` on the swf. `volume` indicates the current\n * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and\n * so on.\n *\n * @method Flash#setVolume\n * @param {number} percentAsDecimal\n *         The volume percent as a decimal. Value will be between 0-1.\n */\n\n/**\n * Set the value of the `muted` on the swf. `muted` indicates that the current\n * audio level should be silent.\n *\n * @method Flash#setMuted\n * @param {boolean} muted\n *         - True if the audio should be set to silent\n *         - False otherwise\n */\n\n/**\n * Set the value of `defaultMuted` on the swf. `defaultMuted` indicates\n * whether the media should start muted or not. Only changes the default state of the\n * media. `muted` and `defaultMuted` can have different values. `muted` indicates the\n * current state.\n *\n * @method Flash#setDefaultMuted\n * @param {boolean} defaultMuted\n *         - True indicates that the media should start muted.\n *         - False indicates that the media should not start muted.\n */\n\n/* Flash Support Testing -------------------------------------------------------- */\n\n/**\n * Check if the Flash tech is currently supported.\n *\n * @return {boolean}\n *          - True for Chrome and Safari Desktop and Microsoft Edge and if flash tech is supported\n *          - False otherwise\n */\nFlash.isSupported = function () {\n  // for Chrome Desktop and Safari Desktop\n  if (videojs.browser.IS_CHROME && (!videojs.browser.IS_ANDROID || !videojs.browser.IS_IOS) || videojs.browser.IS_SAFARI && !videojs.browser.IS_IOS || videojs.browser.IS_EDGE) {\n    return true;\n  }\n  // for other browsers\n  return Flash.version()[0] >= 10;\n};\n\n// Add Source Handler pattern functions to this tech\nTech.withSourceHandlers(Flash);\n\n/*\n * Native source handler for flash,  simply passes the source to the swf element.\n *\n * @property {Tech~SourceObject} source\n *           The source object\n *\n * @property {Flash} tech\n *           The instance of the Flash tech\n */\nFlash.nativeSourceHandler = {};\n\n/**\n * Check if the Flash can play the given mime type.\n *\n * @param {string} type\n *        The mimetype to check\n *\n * @return {string}\n *         'maybe', or '' (empty string)\n */\nFlash.nativeSourceHandler.canPlayType = function (type) {\n  if (type in Flash.formats) {\n    return 'maybe';\n  }\n\n  return '';\n};\n\n/**\n * Check if the media element can handle a source natively.\n *\n * @param {Tech~SourceObject} source\n *         The source object\n *\n * @param {Object} [options]\n *         Options to be passed to the tech.\n *\n * @return {string}\n *         'maybe', or '' (empty string).\n */\nFlash.nativeSourceHandler.canHandleSource = function (source, options) {\n  var type = void 0;\n\n  /**\n   * Guess the mime type of a file if it does not have one\n   *\n   * @param {Tech~SourceObject} src\n   *        The source object to guess the mime type for\n   *\n   * @return {string}\n   *         The mime type that was guessed\n   */\n  function guessMimeType(src) {\n    var ext = Url.getFileExtension(src);\n\n    if (ext) {\n      return 'video/' + ext;\n    }\n    return '';\n  }\n\n  if (!source.type) {\n    type = guessMimeType(source.src);\n  } else {\n    // Strip code information from the type because we don't get that specific\n    type = source.type.replace(/;.*/, '').toLowerCase();\n  }\n\n  return Flash.nativeSourceHandler.canPlayType(type);\n};\n\n/**\n * Pass the source to the swf.\n *\n * @param {Tech~SourceObject} source\n *        The source object\n *\n * @param {Flash} tech\n *        The instance of the Flash tech\n *\n * @param {Object} [options]\n *        The options to pass to the source\n */\nFlash.nativeSourceHandler.handleSource = function (source, tech, options) {\n  tech.setSrc(source.src);\n};\n\n/**\n * noop for native source handler dispose, as cleanup will happen automatically.\n */\nFlash.nativeSourceHandler.dispose = function () {};\n\n// Register the native source handler\nFlash.registerSourceHandler(Flash.nativeSourceHandler);\n\n/**\n * Flash supported mime types.\n *\n * @constant {Object}\n */\nFlash.formats = {\n  'video/flv': 'FLV',\n  'video/x-flv': 'FLV',\n  'video/mp4': 'MP4',\n  'video/m4v': 'MP4'\n};\n\n/**\n * Called when the the swf is \"ready\", and makes sure that the swf is really\n * ready using {@link Flash#checkReady}\n *\n * @param {Object} currSwf\n *        The current swf object\n */\nFlash.onReady = function (currSwf) {\n  var el = Dom.$('#' + currSwf);\n  var tech = el && el.tech;\n\n  // if there is no el then the tech has been disposed\n  // and the tech element was removed from the player div\n  if (tech && tech.el()) {\n    // check that the flash object is really ready\n    Flash.checkReady(tech);\n  }\n};\n\n/**\n * The SWF isn't always ready when it says it is. Sometimes the API functions still\n * need to be added to the object. If it's not ready, we set a timeout to check again\n * shortly.\n *\n * @param {Flash} tech\n *        The instance of the flash tech to check.\n */\nFlash.checkReady = function (tech) {\n  // stop worrying if the tech has been disposed\n  if (!tech.el()) {\n    return;\n  }\n\n  // check if API property exists\n  if (tech.el().vjs_getProperty) {\n    // tell tech it's ready\n    tech.triggerReady();\n  } else {\n    // wait longer\n    this.setTimeout(function () {\n      Flash.checkReady(tech);\n    }, 50);\n  }\n};\n\n/**\n * Trigger events from the swf on the Flash Tech.\n *\n * @param {number} swfID\n *        The id of the swf that had the event\n *\n * @param {string} eventName\n *        The name of the event to trigger\n */\nFlash.onEvent = function (swfID, eventName) {\n  var tech = Dom.$('#' + swfID).tech;\n  var args = Array.prototype.slice.call(arguments, 2);\n\n  // dispatch Flash events asynchronously for two reasons:\n  // - Flash swallows any exceptions generated by javascript it\n  //   invokes\n  // - Flash is suspended until the javascript returns which may cause\n  //   playback performance issues\n  tech.setTimeout(function () {\n    tech.trigger(eventName, args);\n  }, 1);\n};\n\n/**\n * Log errors from the swf on the Flash tech.\n *\n * @param {number} swfID\n *        The id of the swf that had an error.\n *\n * @param {string} err\n *        The error to set on the Flash Tech.\n *\n * @return {MediaError|undefined}\n *          - Returns a MediaError when err is 'srcnotfound'\n *          - Returns undefined otherwise.\n */\nFlash.onError = function (swfID, err) {\n  var tech = Dom.$('#' + swfID).tech;\n\n  // trigger MEDIA_ERR_SRC_NOT_SUPPORTED\n  if (err === 'srcnotfound') {\n    return tech.error(4);\n  }\n\n  // trigger a custom error\n  if (typeof err === 'string') {\n    tech.error('FLASH: ' + err);\n  } else {\n    err.origin = 'flash';\n    tech.error(err);\n  }\n};\n\n/**\n * Get the current version of Flash that is in use on the page.\n *\n * @return {Array}\n *          an array of versions that are available.\n */\nFlash.version = function () {\n  var version$$1 = '0,0,0';\n\n  // IE\n  try {\n    version$$1 = new window.ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\\D+/g, ',').match(/^,?(.+),?$/)[1];\n\n    // other browsers\n  } catch (e) {\n    try {\n      if (navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {\n        version$$1 = (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']).description.replace(/\\D+/g, ',').match(/^,?(.+),?$/)[1];\n      }\n    } catch (err) {\n      // satisfy linter\n    }\n  }\n  return version$$1.split(',');\n};\n\n/**\n * Only use for non-iframe embeds.\n *\n * @param {Object} swf\n *        The videojs-swf object.\n *\n * @param {Object} flashVars\n *        Names and values to use as flash option variables.\n *\n * @param {Object} params\n *        Style parameters to set on the object.\n *\n * @param {Object} attributes\n *        Attributes to set on the element.\n *\n * @return {Element}\n *          The embeded Flash DOM element.\n */\nFlash.embed = function (swf, flashVars, params, attributes) {\n  var code = Flash.getEmbedCode(swf, flashVars, params, attributes);\n\n  // Get element by embedding code and retrieving created element\n  var obj = Dom.createEl('div', { innerHTML: code }).childNodes[0];\n\n  return obj;\n};\n\n/**\n * Only use for non-iframe embeds.\n *\n * @param {Object} swf\n *        The videojs-swf object.\n *\n * @param {Object} flashVars\n *        Names and values to use as flash option variables.\n *\n * @param {Object} params\n *        Style parameters to set on the object.\n *\n * @param {Object} attributes\n *        Attributes to set on the element.\n *\n * @return {Element}\n *          The embeded Flash DOM element.\n */\nFlash.getEmbedCode = function (swf, flashVars, params, attributes) {\n  var objTag = '<object type=\"application/x-shockwave-flash\" ';\n  var flashVarsString = '';\n  var paramsString = '';\n  var attrsString = '';\n\n  // Convert flash vars to string\n  if (flashVars) {\n    Object.getOwnPropertyNames(flashVars).forEach(function (key) {\n      flashVarsString += key + '=' + flashVars[key] + '&amp;';\n    });\n  }\n\n  // Add swf, flashVars, and other default params\n  params = mergeOptions({\n    movie: swf,\n    flashvars: flashVarsString,\n    // Required to talk to swf\n    allowScriptAccess: 'always',\n    // All should be default, but having security issues.\n    allowNetworking: 'all'\n  }, params);\n\n  // Create param tags string\n  Object.getOwnPropertyNames(params).forEach(function (key) {\n    paramsString += '<param name=\"' + key + '\" value=\"' + params[key] + '\" />';\n  });\n\n  attributes = mergeOptions({\n    // Add swf to attributes (need both for IE and Others to work)\n    data: swf,\n\n    // Default to 100% width/height\n    width: '100%',\n    height: '100%'\n\n  }, attributes);\n\n  // Create Attributes string\n  Object.getOwnPropertyNames(attributes).forEach(function (key) {\n    attrsString += key + '=\"' + attributes[key] + '\" ';\n  });\n\n  return '' + objTag + attrsString + '>' + paramsString + '</object>';\n};\n\n// Run Flash through the RTMP decorator\nFlashRtmpDecorator(Flash);\n\nif (Tech.getTech('Flash')) {\n  videojs.log.warn('Not using videojs-flash as it appears to already be registered');\n  videojs.log.warn('videojs-flash should only be used with video.js@6 and above');\n} else {\n  videojs.registerTech('Flash', Flash);\n}\n\nFlash.VERSION = version;\n\nmodule.exports = Flash;\n"]}