diff --git a/CHANGES.md b/CHANGES.md index 499f8477..3fbde66d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,12 @@ videojs-wavesurfer changelog ============================ +2.1.2 - unreleased +------------------ + +- Fix compatibility issue with videojs-record plugin (#46) + + 2.1.1 - 2017/12/12 ------------------ diff --git a/src/js/tech.js b/src/js/tech.js index 3faf1394..753b8e3e 100644 --- a/src/js/tech.js +++ b/src/js/tech.js @@ -46,14 +46,21 @@ class WavesurferTech extends Html5 { } /** - * Determine whether or not the player is trying use wavesurfer + * Determine whether or not the player is trying use the wavesurfer plugin * @returns {boolean} */ playerIsUsingWavesurfer() { - return this.activePlayer.activeWavesurferPlugin !== undefined; + let availablePlugins = videojs.getPlugins(); + let usingWavesurferPlugin = 'wavesurfer' in availablePlugins; + let usingRecordPlugin = 'record' in availablePlugins; + + return usingWavesurferPlugin && !usingRecordPlugin; } + /** + * Start playback. + */ play() { if (!this.playerIsUsingWavesurfer()) { // fall back to html5 tech functionality @@ -63,6 +70,9 @@ class WavesurferTech extends Html5 { return this.activePlayer.activeWavesurferPlugin.play(); } + /** + * Pause playback. + */ pause() { if (!this.playerIsUsingWavesurfer()) { //fall back to html5 tech functionality