Skip to content

Commit

Permalink
Merge accacfd into 8ff605d
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Oct 7, 2018
2 parents 8ff605d + accacfd commit 388f626
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
@@ -1,6 +1,12 @@
videojs-wavesurfer changelog
============================

2.6.1 - unreleased
------------------

- Fix hiding time controls (#73)


2.6.0 - 2018/10/04
------------------

Expand Down
9 changes: 6 additions & 3 deletions src/js/videojs.wavesurfer.js
Expand Up @@ -499,10 +499,12 @@ class Wavesurfer extends Plugin {

currentTime = isNaN(currentTime) ? 0 : currentTime;
duration = isNaN(duration) ? 0 : duration;
let time = Math.min(currentTime, duration);

// update current time display component
if (this.player.controlBar.currentTimeDisplay.contentEl()) {
if (this.player.controlBar.currentTimeDisplay &&
this.player.controlBar.currentTimeDisplay.contentEl()) {
let time = Math.min(currentTime, duration);

this.player.controlBar.currentTimeDisplay.formattedTime_ =
this.player.controlBar.currentTimeDisplay.contentEl().lastChild.textContent =
formatTime(time, duration, this.msDisplayMax);
Expand Down Expand Up @@ -539,7 +541,8 @@ class Wavesurfer extends Plugin {
duration = isNaN(duration) ? 0 : duration;

// update duration display component
if (this.player.controlBar.durationDisplay.contentEl()) {
if (this.player.controlBar.durationDisplay &&
this.player.controlBar.durationDisplay.contentEl()) {
this.player.controlBar.durationDisplay.formattedTime_ =
this.player.controlBar.durationDisplay.contentEl().lastChild.textContent =
formatTime(duration, duration, this.msDisplayMax);
Expand Down

0 comments on commit 388f626

Please sign in to comment.