Skip to content

Commit

Permalink
Merge 95be88d into 33be0ba
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzenz Hersche committed May 23, 2018
2 parents 33be0ba + 95be88d commit 274f97d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 129 deletions.
16 changes: 11 additions & 5 deletions src/js/videojs.wavesurfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Wavesurfer extends Plugin {
*/
initialize() {
// setup tech
this.player.tech_.setActivePlayer(this.player);
// this.player.tech_.setActivePlayer(this.player);

// hide big play button
this.player.bigPlayButton.hide();
Expand Down Expand Up @@ -476,10 +476,11 @@ class Wavesurfer extends Plugin {
* @param {number} [duration] - Duration of the waveform (in seconds).
* @private
*/
setCurrentTime(currentTime, duration) {
// emit the timeupdate event so that the tech knows about the time change
this.trigger('timeupdate');
setCurrentTime(currentTime, duration, force = false) {

this.progressCounter = 0;
// emit the timeupdate event so that the tech knows about the time change
// this.trigger('timeupdate');
if (currentTime === undefined) {
currentTime = this.surfer.getCurrentTime();
}
Expand Down Expand Up @@ -519,6 +520,7 @@ class Wavesurfer extends Plugin {
* @private
*/
setDuration(duration) {

if (duration === undefined) {
duration = this.surfer.getDuration();
}
Expand Down Expand Up @@ -547,6 +549,7 @@ class Wavesurfer extends Plugin {
this.player.trigger('waveReady');

// update time display
this.progressCounter = 50;
this.setCurrentTime();
this.setDuration();

Expand Down Expand Up @@ -574,6 +577,8 @@ class Wavesurfer extends Plugin {
*/
onWaveFinish() {
this.log('Finished playback');
this.progressCounter = 50;
this.setCurrentTime();

// notify listeners
this.player.trigger('playbackFinish');
Expand Down Expand Up @@ -618,6 +623,7 @@ class Wavesurfer extends Plugin {
* @private
*/
onWaveSeek() {
this.progressCounter = 50;
this.setCurrentTime();
}

Expand Down Expand Up @@ -767,7 +773,7 @@ if (videojs.getPlugin('wavesurfer') === undefined) {
// register the WavesurferTech as 'Html5' to override the default html5 tech.
// If we register it as anything other then 'Html5', the <audio> element will
// be removed by VJS and caption tracks will be lost in the Safari browser.
videojs.registerTech('Html5', WavesurferTech);
// videojs.registerTech('Html5', WavesurferTech);

module.exports = {
Wavesurfer
Expand Down
124 changes: 0 additions & 124 deletions test/tech.spec.js

This file was deleted.

0 comments on commit 274f97d

Please sign in to comment.