1
|
{"version":3,"sources":["webpack://VideojsWavesurfer/webpack/universalModuleDefinition","webpack://VideojsWavesurfer/webpack/bootstrap","webpack://VideojsWavesurfer/./src/js/videojs.wavesurfer.js","webpack://VideojsWavesurfer/./src/js/utils/log.js","webpack://VideojsWavesurfer/./src/js/utils/format-time.js","webpack://VideojsWavesurfer/./src/js/defaults.js","webpack://VideojsWavesurfer/./node_modules/global/window.js","webpack://VideojsWavesurfer/(webpack)/buildin/global.js","webpack://VideojsWavesurfer/external \"videojs\"","webpack://VideojsWavesurfer/external \"WaveSurfer\""],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__7__","__WEBPACK_EXTERNAL_MODULE__8__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Plugin","_video2","default","getPlugin","Wavesurfer","player","options","_classCallCheck","this","_this","_possibleConstructorReturn","__proto__","getPrototypeOf","addClass","mergeOptions","_defaults2","waveReady","waveFinished","liveMode","debug","toString","msDisplayMax","parseFloat","textTracksEnabled","options_","tracks","length","src","undefined","_wavesurfer2","microphone","onWaveError","one","initialize","bigPlayButton","hide","usingNativeControls_","tech_","el_","controls","controlBar","show","style","display","progressControl","currentTimeDisplay","timeDivider","durationDisplay","forEach","element","remainingTimeDisplay","playToggle","on","onPlayToggle","mergedOptions","parseOptions","plugins","wavesurfer","surfer","onWaveFinish","surferReady","onWaveReady","surferProgress","onWaveProgress","surferSeek","onWaveSeek","setupPlaybackEvents","onVolumeChange","onScreenChange","muted","setVolume","fluid","drawer","wrapper","className","responsiveWave","util","debounce","onResizeChange","_window2","addEventListener","off","throttledUpdateContent","trackCurrentTime","startPlayers","surferOpts","rect","getBoundingClientRect","originalWidth","width","originalHeight","height","controlBarHeight","container","waveformHeight","playerHeight","opts","splitChannels","log","loadingSpinner","load","peaks","enable","un","url","_this2","Blob","File","JSON","stringify","loadBlob","Array","isArray","ajaxOptions","responseType","xhr","ajax","data","e","target","status","handlePlay","active","paused","pause","play","start","contentEl","handlePause","setCurrentTime","destroy","stopTrackingCurrentTime","children","dispose","volume","format","quality","exportImage","deviceId","_this3","setSinkId","then","result","trigger","catch","err","currentTime","getCurrentTime","isNaN","duration","getDuration","time","Math","min","formattedTime_","lastChild","textContent","_formatTime2","setDuration","autoplay","_this4","loop","stop","once","removeClass","error","hasClass","isPlaying","_this5","fullscreenDelay","setInterval","newWidth","newHeight","isFullscreen","redrawWaveform","clearInterval","isDestroyed","params","createDrawer","drawBuffer","progress","backend","getPlayedPercents","args","logType","_log3","VERSION","registerPlugin","videojs","warn","seconds","guide","floor","h","gm","gh","ms","Infinity","global","win","self","g","Function","eval"],"mappings":";;;;;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,WAAAA,QAAA,eACA,mBAAAC,eAAAC,IACAD,OAAA,6CAAAJ,GACA,iBAAAC,QACAA,QAAA,kBAAAD,EAAAG,QAAA,WAAAA,QAAA,eAEAJ,EAAA,kBAAAC,EAAAD,EAAA,QAAAA,EAAA,YARA,CASCO,OAAA,SAAAC,EAAAC,GACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAV,QAGA,IAAAC,EAAAO,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAZ,YAUA,OANAa,EAAAH,GAAAI,KAAAb,EAAAD,QAAAC,IAAAD,QAAAS,GAGAR,EAAAW,GAAA,EAGAX,EAAAD,QA0DA,OArDAS,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAjB,EAAAkB,EAAAC,GACAV,EAAAW,EAAApB,EAAAkB,IACAG,OAAAC,eAAAtB,EAAAkB,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA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M,KADA,GAIA,IAEAiM,KAAAC,SAAA,cAAAA,KAAA,EAAAC,MAAA,QACC,MAAArF,GAED,iBAAA5J,SAAA+O,EAAA/O,QAOAJ,EAAAD,QAAAoP,iBCnBAnP,EAAAD,QAAAM,iBCAAL,EAAAD,QAAAO","file":"videojs.wavesurfer.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"videojs\"), require(\"WaveSurfer\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"VideojsWavesurfer\", [\"videojs\", \"WaveSurfer\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VideojsWavesurfer\"] = factory(require(\"videojs\"), require(\"WaveSurfer\"));\n\telse\n\t\troot[\"VideojsWavesurfer\"] = factory(root[\"videojs\"], root[\"WaveSurfer\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__8__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * @file videojs.wavesurfer.js\n *\n * The main file for the videojs-wavesurfer project.\n * MIT license: https://github.com/collab-project/videojs-wavesurfer/blob/master/LICENSE\n */\n\nimport log from './utils/log';\nimport formatTime from './utils/format-time';\nimport pluginDefaultOptions from './defaults';\nimport window from 'global/window';\n\nimport videojs from 'video.js';\nimport WaveSurfer from 'wavesurfer.js';\n\nconst Plugin = videojs.getPlugin('plugin');\n\nconst wavesurferClassName = 'vjs-wavedisplay';\n\n/**\n * Draw a waveform for audio and video files in a video.js player.\n *\n * @class Wavesurfer\n * @extends videojs.Plugin\n */\nclass Wavesurfer extends Plugin {\n /**\n * The constructor function for the class.\n *\n * @param {(videojs.Player|Object)} player\n * @param {Object} options - Player options.\n */\n constructor(player, options) {\n super(player, options);\n\n // add plugin style\n player.addClass('vjs-wavesurfer');\n\n // parse options\n options = videojs.mergeOptions(pluginDefaultOptions, options);\n this.waveReady = false;\n this.waveFinished = false;\n this.liveMode = false;\n this.debug = (options.debug.toString() === 'true');\n this.msDisplayMax = parseFloat(options.msDisplayMax);\n this.textTracksEnabled = (this.player.options_.tracks.length > 0);\n\n // microphone plugin\n if (options.src === 'live') {\n // check if the wavesurfer.js microphone plugin can be enabled\n if (WaveSurfer.microphone !== undefined) {\n // enable audio input from a microphone\n this.liveMode = true;\n this.waveReady = true;\n } else {\n this.onWaveError('Could not find wavesurfer.js ' +\n 'microphone plugin!');\n return;\n }\n }\n\n // wait until player ui is ready\n this.player.one('ready', this.initialize.bind(this));\n }\n\n /**\n * Player UI is ready: customize controls.\n */\n initialize() {\n // hide big play button\n this.player.bigPlayButton.hide();\n\n // the native controls don't work for this UI so disable\n // them no matter what\n if (this.player.usingNativeControls_ === true) {\n if (this.player.tech_.el_ !== undefined) {\n this.player.tech_.el_.controls = false;\n }\n }\n\n // controls\n if (this.player.options_.controls === true) {\n // make sure controlBar is showing\n this.player.controlBar.show();\n this.player.controlBar.el_.style.display = 'flex';\n\n // progress control isn't used by this plugin\n this.player.controlBar.progressControl.hide();\n\n // make sure time displays are visible\n let uiElements = [\n this.player.controlBar.currentTimeDisplay,\n this.player.controlBar.timeDivider,\n this.player.controlBar.durationDisplay\n ];\n uiElements.forEach((element) => {\n // ignore and show when essential elements have been disabled\n // by user\n if (element !== undefined) {\n element.el_.style.display = 'block';\n element.show();\n }\n });\n if (this.player.controlBar.remainingTimeDisplay !== undefined) {\n this.player.controlBar.remainingTimeDisplay.hide();\n }\n\n // handle play toggle interaction\n this.player.controlBar.playToggle.on(['tap', 'click'],\n this.onPlayToggle.bind(this));\n\n // disable play button until waveform is ready\n // (except when in live mode)\n if (!this.liveMode) {\n this.player.controlBar.playToggle.hide();\n }\n }\n\n // wavesurfer.js setup\n let mergedOptions = this.parseOptions(this.player.options_.plugins.wavesurfer);\n this.surfer = WaveSurfer.create(mergedOptions);\n this.surfer.on('error', this.onWaveError.bind(this));\n this.surfer.on('finish', this.onWaveFinish.bind(this));\n if (this.liveMode === true) {\n // listen for wavesurfer.js microphone plugin events\n this.surfer.microphone.on('deviceError', this.onWaveError.bind(this));\n }\n this.surferReady = this.onWaveReady.bind(this);\n this.surferProgress = this.onWaveProgress.bind(this);\n this.surferSeek = this.onWaveSeek.bind(this);\n\n // only listen to these wavesurfer.js playback events when not\n // in live mode\n if (!this.liveMode) {\n this.setupPlaybackEvents(true);\n }\n\n // video.js player events\n this.player.on('volumechange', this.onVolumeChange.bind(this));\n this.player.on('fullscreenchange', this.onScreenChange.bind(this));\n\n // make sure volume is muted when requested\n if (this.player.muted()) {\n this.setVolume(0);\n }\n\n // video.js fluid option\n if (this.player.options_.fluid === true) {\n // give wave element a classname so it can be styled\n this.surfer.drawer.wrapper.className = wavesurferClassName;\n // listen for window resize events\n this.responsiveWave = WaveSurfer.util.debounce(\n this.onResizeChange.bind(this), 150);\n window.addEventListener('resize', this.responsiveWave);\n }\n\n // text tracks\n if (this.textTracksEnabled) {\n // disable timeupdates\n this.player.controlBar.currentTimeDisplay.off(this.player, 'timeupdate',\n this.player.controlBar.currentTimeDisplay.throttledUpdateContent);\n\n // sets up an interval function to track current time\n // and trigger timeupdate every 250 milliseconds.\n // needed for text tracks\n this.player.tech_.trackCurrentTime();\n }\n\n // kick things off\n this.startPlayers();\n }\n\n /**\n * Initializes the waveform options.\n *\n * @param {Object} surferOpts - Plugin options.\n * @private\n */\n parseOptions(surferOpts) {\n let rect = this.player.el_.getBoundingClientRect();\n this.originalWidth = this.player.options_.width || rect.width;\n this.originalHeight = this.player.options_.height || rect.height;\n\n // controlbar\n let controlBarHeight = this.player.controlBar.height();\n if (this.player.options_.controls === true && controlBarHeight === 0) {\n // the dimensions of the controlbar are not known yet, but we\n // need it now, so we can calculate the height of the waveform.\n // The default height is 30px, so use that instead.\n controlBarHeight = 30;\n }\n\n // set waveform element and dimensions\n // Set the container to player's container if \"container\" option is\n // not provided. If a waveform needs to be appended to your custom\n // element, then use below option. For example:\n // container: document.querySelector(\"#vjs-waveform\")\n if (surferOpts.container === undefined) {\n surferOpts.container = this.player.el_;\n }\n\n // set the height of generated waveform if user has provided height\n // from options. If height of waveform need to be customized then use\n // option below. For example: waveformHeight: 30\n if (surferOpts.waveformHeight === undefined) {\n let playerHeight = rect.height;\n surferOpts.height = playerHeight - controlBarHeight;\n } else {\n surferOpts.height = opts.waveformHeight;\n }\n\n // split channels\n if (surferOpts.splitChannels && surferOpts.splitChannels === true) {\n surferOpts.height /= 2;\n }\n\n // enable wavesurfer.js microphone plugin\n if (this.liveMode === true) {\n surferOpts.plugins = [\n WaveSurfer.microphone.create(surferOpts)\n ];\n this.log('wavesurfer.js microphone plugin enabled.');\n }\n\n return surferOpts;\n }\n\n /**\n * Start the players.\n * @private\n */\n startPlayers() {\n let options = this.player.options_.plugins.wavesurfer;\n if (options.src !== undefined) {\n if (this.surfer.microphone === undefined) {\n // show loading spinner\n this.player.loadingSpinner.show();\n\n // start loading file\n this.load(options.src, options.peaks);\n } else {\n // hide loading spinner\n this.player.loadingSpinner.hide();\n\n // connect microphone input to our waveform\n options.wavesurfer = this.surfer;\n }\n } else {\n // no valid src found, hide loading spinner\n this.player.loadingSpinner.hide();\n }\n }\n\n /**\n * Starts or stops listening to events related to audio-playback.\n *\n * @param {boolean} enable - Start or stop listening to playback\n * related events.\n * @private\n */\n setupPlaybackEvents(enable) {\n if (enable === false) {\n this.surfer.un('ready', this.surferReady);\n this.surfer.un('audioprocess', this.surferProgress);\n this.surfer.un('seek', this.surferSeek);\n } else if (enable === true) {\n this.surfer.on('ready', this.surferReady);\n this.surfer.on('audioprocess', this.surferProgress);\n this.surfer.on('seek', this.surferSeek);\n }\n }\n\n /**\n * Start loading waveform data.\n *\n * @param {string|blob|file} url - Either the URL of the audio file,\n * a Blob or a File object.\n * @param {string|?number[]|number[][]} peaks - Either the URL of peaks\n * data for the audio file, or an array with peaks data.\n */\n load(url, peaks) {\n if (url instanceof Blob || url instanceof File) {\n this.log('Loading object: ' + JSON.stringify(url));\n this.surfer.loadBlob(url);\n } else {\n // load peak data from file\n if (peaks !== undefined) {\n if (Array.isArray(peaks)) {\n // use supplied peaks data\n this.log('Loading URL: ' + url);\n this.surfer.load(url, peaks);\n } else {\n // load peak data from file\n let ajaxOptions = {\n url: peaks,\n responseType: 'json'\n };\n // supply xhr options, if any\n if (this.player.options_.plugins.wavesurfer.xhr !== undefined) {\n ajaxOptions.xhr = this.player.options_.plugins.wavesurfer.xhr;\n }\n let ajax = WaveSurfer.util.ajax(ajaxOptions);\n\n ajax.on('success', (data, e) => {\n this.log('Loaded Peak Data URL: ' + peaks);\n this.surfer.load(url, data.data);\n });\n ajax.on('error', (e) => {\n this.log('Unable to retrieve peak data from ' + peaks +\n '. Status code: ' + e.target.status, 'warn');\n this.log('Loading URL: ' + url);\n this.surfer.load(url);\n });\n }\n } else {\n // no peaks\n this.log('Loading URL: ' + url);\n this.surfer.load(url);\n }\n }\n }\n\n /**\n * Start/resume playback or microphone.\n */\n play() {\n // show pause button\n this.player.controlBar.playToggle.handlePlay();\n\n if (this.liveMode) {\n // start/resume microphone visualization\n if (!this.surfer.microphone.active)\n {\n this.log('Start microphone');\n this.surfer.microphone.start();\n } else {\n // toggle paused\n let paused = !this.surfer.microphone.paused;\n\n if (paused) {\n this.pause();\n } else {\n this.log('Resume microphone');\n this.surfer.microphone.play();\n }\n }\n } else {\n this.log('Start playback');\n\n // put video.js player UI in playback mode\n this.player.play();\n\n // start surfer playback\n this.surfer.play();\n }\n }\n\n /**\n * Pauses playback or microphone visualization.\n */\n pause() {\n // show play button\n if (this.player.controlBar.playToggle.contentEl()) {\n this.player.controlBar.playToggle.handlePause();\n }\n\n if (this.liveMode) {\n // pause microphone visualization\n this.log('Pause microphone');\n this.surfer.microphone.pause();\n } else {\n // pause playback\n this.log('Pause playback');\n\n if (!this.waveFinished) {\n // pause wavesurfer playback\n this.surfer.pause();\n } else {\n this.waveFinished = false;\n }\n\n this.setCurrentTime();\n }\n }\n\n /**\n * @private\n */\n dispose() {\n if (this.surfer) {\n if (this.liveMode && this.surfer.microphone) {\n // destroy microphone plugin\n this.surfer.microphone.destroy();\n this.log('Destroyed microphone plugin');\n }\n // destroy wavesurfer instance\n this.surfer.destroy();\n }\n if (this.textTracksEnabled) {\n this.player.tech_.stopTrackingCurrentTime();\n }\n this.log('Destroyed plugin');\n }\n\n /**\n * Indicates whether the plugin is destroyed or not.\n *\n * @return {boolean} Plugin destroyed or not.\n */\n isDestroyed() {\n return this.player && (this.player.children() === null);\n }\n\n /**\n * Remove the player and waveform.\n */\n destroy() {\n this.player.dispose();\n }\n\n /**\n * Set the volume level.\n *\n * @param {number} volume - The new volume level.\n */\n setVolume(volume) {\n if (volume !== undefined) {\n this.log('Changing volume to: ' + volume);\n\n // update player volume\n this.player.volume(volume);\n }\n }\n\n /**\n * Save waveform image as data URI.\n *\n * The default format is 'image/png'. Other supported types are\n * 'image/jpeg' and 'image/webp'.\n *\n * @param {string} [format=image/png] - String indicating the image format.\n * @param {number} [quality=1] - Number between 0 and 1 indicating image\n * quality if the requested type is 'image/jpeg' or 'image/webp'.\n * @returns {string} The data URI of the image data.\n */\n exportImage(format, quality) {\n return this.surfer.exportImage(format, quality);\n }\n\n /**\n * Change the audio output device.\n *\n * @param {string} sinkId - Id of audio output device.\n */\n setAudioOutput(deviceId) {\n if (deviceId) {\n this.surfer.setSinkId(deviceId).then((result) => {\n // notify listeners\n this.player.trigger('audioOutputReady');\n }).catch((err) => {\n // notify listeners\n this.player.trigger('error', err);\n\n this.log(err, 'error');\n });\n }\n }\n\n /**\n * Get the current time (in seconds) of the stream during playback.\n *\n * Returns 0 if no stream is available (yet).\n */\n getCurrentTime() {\n let currentTime = this.surfer.getCurrentTime();\n currentTime = isNaN(currentTime) ? 0 : currentTime;\n\n return currentTime;\n }\n\n /**\n * Updates the player's element displaying the current time.\n *\n * @param {number} [currentTime] - Current position of the playhead\n * (in seconds).\n * @param {number} [duration] - Duration of the waveform (in seconds).\n * @private\n */\n setCurrentTime(currentTime, duration) {\n if (currentTime === undefined) {\n currentTime = this.surfer.getCurrentTime();\n }\n\n if (duration === undefined) {\n duration = this.surfer.getDuration();\n }\n\n currentTime = isNaN(currentTime) ? 0 : currentTime;\n duration = isNaN(duration) ? 0 : duration;\n let time = Math.min(currentTime, duration);\n\n // update current time display component\n if (this.player.controlBar.currentTimeDisplay.contentEl()) {\n this.player.controlBar.currentTimeDisplay.formattedTime_ =\n this.player.controlBar.currentTimeDisplay.contentEl().lastChild.textContent =\n formatTime(time, duration, this.msDisplayMax);\n }\n\n if (this.textTracksEnabled) {\n // only needed for text tracks\n this.player.tech_.setCurrentTime(currentTime);\n }\n }\n\n /**\n * Get the duration of the stream in seconds.\n *\n * Returns 0 if no stream is available (yet).\n */\n getDuration() {\n let duration = this.surfer.getDuration();\n duration = isNaN(duration) ? 0 : duration;\n\n return duration;\n }\n\n /**\n * Updates the player's element displaying the duration time.\n *\n * @param {number} [duration] - Duration of the waveform (in seconds).\n * @private\n */\n setDuration(duration) {\n if (duration === undefined) {\n duration = this.surfer.getDuration();\n }\n duration = isNaN(duration) ? 0 : duration;\n\n // update duration display component\n if (this.player.controlBar.durationDisplay.contentEl()) {\n this.player.controlBar.durationDisplay.formattedTime_ =\n this.player.controlBar.durationDisplay.contentEl().lastChild.textContent =\n formatTime(duration, duration, this.msDisplayMax);\n }\n }\n\n /**\n * Audio is loaded, decoded and the waveform is drawn.\n *\n * @fires waveReady\n * @private\n */\n onWaveReady() {\n this.waveReady = true;\n this.waveFinished = false;\n this.liveMode = false;\n\n this.log('Waveform is ready');\n this.player.trigger('waveReady');\n\n // update time display\n this.setCurrentTime();\n this.setDuration();\n\n // enable and show play button\n if (this.player.controlBar.playToggle.contentEl()) {\n this.player.controlBar.playToggle.show();\n }\n\n // hide loading spinner\n if (this.player.loadingSpinner.contentEl()) {\n this.player.loadingSpinner.hide();\n }\n\n // auto-play when ready (if enabled)\n if (this.player.options_.autoplay === true) {\n this.play();\n }\n }\n\n /**\n * Fires when audio playback completed.\n *\n * @fires playbackFinish\n * @private\n */\n onWaveFinish() {\n this.log('Finished playback');\n\n // notify listeners\n this.player.trigger('playbackFinish');\n\n // check if loop is enabled\n if (this.player.options_.loop === true) {\n // reset waveform\n this.surfer.stop();\n this.play();\n } else {\n // finished\n this.waveFinished = true;\n\n // pause player\n this.pause();\n\n // show the replay state of play toggle\n this.player.trigger('ended');\n\n // this gets called once after the clip has ended and the user\n // seeks so that we can change the replay button back to a play\n // button\n this.surfer.once('seek', () => {\n this.player.controlBar.playToggle.removeClass('vjs-ended');\n this.player.trigger('pause');\n });\n }\n }\n\n /**\n * Fires continuously during audio playback.\n *\n * @param {number} time - Current time/location of the playhead.\n * @private\n */\n onWaveProgress(time) {\n this.setCurrentTime();\n }\n\n /**\n * Fires during seeking of the waveform.\n * @private\n */\n onWaveSeek() {\n this.setCurrentTime();\n }\n\n /**\n * Waveform error.\n *\n * @param {string} error - The wavesurfer error.\n * @private\n */\n onWaveError(error) {\n // notify listeners\n this.player.trigger('error', error);\n\n this.log(error, 'error');\n }\n\n /**\n * Fired when the play toggle is clicked.\n * @private\n */\n onPlayToggle() {\n // workaround for video.js 6.3.1 and newer\n if (this.player.controlBar.playToggle.hasClass('vjs-ended')) {\n this.player.controlBar.playToggle.removeClass('vjs-ended');\n }\n if (this.surfer.isPlaying()) {\n this.pause();\n } else {\n this.play();\n }\n }\n\n /**\n * Fired when the volume in the video.js player changes.\n * @private\n */\n onVolumeChange() {\n let volume = this.player.volume();\n if (this.player.muted()) {\n // muted volume\n volume = 0;\n }\n\n // update wavesurfer.js volume\n this.surfer.setVolume(volume);\n }\n\n /**\n * Fired when the video.js player switches in or out of fullscreen mode.\n * @private\n */\n onScreenChange() {\n // execute with tiny delay so the player element completes\n // rendering and correct dimensions are reported\n var fullscreenDelay = this.player.setInterval(() => {\n let isFullscreen = this.player.isFullscreen();\n let newWidth, newHeight;\n if (!isFullscreen) {\n // restore original dimensions\n newWidth = this.originalWidth;\n newHeight = this.originalHeight;\n }\n\n if (this.waveReady) {\n if (this.liveMode && !this.surfer.microphone.active) {\n // we're in live mode but the microphone hasn't been\n // started yet\n return;\n }\n // redraw\n this.redrawWaveform(newWidth, newHeight);\n }\n\n // stop fullscreenDelay interval\n this.player.clearInterval(fullscreenDelay);\n\n }, 100);\n }\n\n /**\n * Fired when the video.js player is resized.\n *\n * @private\n */\n onResizeChange() {\n if (this.surfer !== undefined) {\n // redraw waveform\n this.redrawWaveform();\n }\n }\n\n /**\n * Redraw waveform.\n *\n * @param {number} [newWidth] - New width for the waveform.\n * @param {number} [newHeight] - New height for the waveform.\n * @private\n */\n redrawWaveform(newWidth, newHeight) {\n if (!this.isDestroyed()) {\n if (this.player.el_) {\n let rect = this.player.el_.getBoundingClientRect();\n if (newWidth === undefined) {\n // get player width\n newWidth = rect.width;\n }\n if (newHeight === undefined) {\n // get player height\n newHeight = rect.height;\n }\n }\n\n // destroy old drawing\n this.surfer.drawer.destroy();\n\n // set new dimensions\n this.surfer.params.width = newWidth;\n this.surfer.params.height = newHeight - this.player.controlBar.height();\n\n // redraw waveform\n this.surfer.createDrawer();\n this.surfer.drawer.wrapper.className = wavesurferClassName;\n this.surfer.drawBuffer();\n\n // make sure playhead is restored at right position\n this.surfer.drawer.progress(this.surfer.backend.getPlayedPercents());\n }\n }\n\n /**\n * @private\n */\n log(args, logType) {\n log(args, logType, this.debug);\n }\n}\n\n// version nr is injected during build\nWavesurfer.VERSION = __VERSION__;\n\n// register plugin once\nvideojs.Wavesurfer = Wavesurfer;\nif (videojs.getPlugin('wavesurfer') === undefined) {\n videojs.registerPlugin('wavesurfer', Wavesurfer);\n}\n\nmodule.exports = {\n Wavesurfer\n};\n","/**\n * @file log.js\n * @since 2.0.0\n */\n\nconst ERROR = 'error';\nconst WARN = 'warn';\n\n/**\n * Log message (if the debug option is enabled).\n */\nconst log = function(args, logType, debug)\n{\n if (debug === true) {\n if (logType === ERROR) {\n videojs.log.error(args);\n } else if (logType === WARN) {\n videojs.log.warn(args);\n } else {\n videojs.log(args);\n }\n }\n};\n\nexport default log;\n","/**\n * @file format-time.js\n * @since 2.0.0\n */\n\n/**\n * Format seconds as a time string, H:MM:SS, M:SS or M:SS:MMM.\n *\n * Supplying a guide (in seconds) will force a number of leading zeros\n * to cover the length of the guide.\n *\n * @param {number} seconds - Number of seconds to be turned into a\n * string.\n * @param {number} guide - Number (in seconds) to model the string\n * after.\n * @param {number} msDisplayMax - Number (in milliseconds) to model the string\n * after.\n * @return {string} Time formatted as H:MM:SS, M:SS or M:SS:MMM, e.g.\n * 0:00:12.\n * @private\n */\nconst formatTime = function(seconds, guide, msDisplayMax) {\n // Default to using seconds as guide\n seconds = seconds < 0 ? 0 : seconds;\n guide = guide || seconds;\n let s = Math.floor(seconds % 60),\n m = Math.floor(seconds / 60 % 60),\n h = Math.floor(seconds / 3600),\n gm = Math.floor(guide / 60 % 60),\n gh = Math.floor(guide / 3600),\n ms = Math.floor((seconds - s) * 1000);\n\n // handle invalid times\n if (isNaN(seconds) || seconds === Infinity) {\n // '-' is false for all relational operators (e.g. <, >=) so this\n // setting will add the minimum number of fields specified by the\n // guide\n h = m = s = ms = '-';\n }\n\n // Check if we need to show milliseconds\n if (guide > 0 && guide < msDisplayMax) {\n if (ms < 100) {\n if (ms < 10) {\n ms = '00' + ms;\n } else {\n ms = '0' + ms;\n }\n }\n ms = ':' + ms;\n } else {\n ms = '';\n }\n\n // Check if we need to show hours\n h = (h > 0 || gh > 0) ? h + ':' : '';\n\n // If hours are showing, we may need to add a leading zero.\n // Always show at least one digit of minutes.\n m = (((h || gm >= 10) && m < 10) ? '0' + m : m) + ':';\n\n // Check if leading zero is need for seconds\n s = ((s < 10) ? '0' + s : s);\n\n return h + m + s + ms;\n};\n\nexport default formatTime;\n","/**\n * @file defaults.js\n * @since 2.0.0\n */\n\n// plugin defaults\nconst pluginDefaultOptions = {\n // Display console log messages.\n debug: false,\n // msDisplayMax indicates the number of seconds that is\n // considered the boundary value for displaying milliseconds\n // in the time controls. An audio clip with a total length of\n // 2 seconds and a msDisplayMax of 3 will use the format\n // M:SS:MMM. Clips longer than msDisplayMax will be displayed\n // as M:SS or HH:MM:SS.\n msDisplayMax: 3\n};\n\nexport default pluginDefaultOptions;\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__7__;","module.exports = __WEBPACK_EXTERNAL_MODULE__8__;"],"sourceRoot":""}
|