Skip to content

Commit

Permalink
MediaElement#getDuration throwing TypeError fixed (katspaugh#720)
Browse files Browse the repository at this point in the history
WaveSurfer.MediaElement#getDuration throwed `TypeError: Not enough
arguments` in Safari 9.1. It also violated contract specified in [HTML
Time
ranges](https://developers.whatwg.org/the-video-element.html#dom-timeranges-end).

This should fix katspaugh#719.
  • Loading branch information
Filip Zrůst authored and katspaugh committed May 12, 2016
1 parent 622322d commit c5adffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mediaelement.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ WaveSurfer.util.extend(WaveSurfer.MediaElement, {
getDuration: function () {
var duration = this.media.duration;
if (duration >= Infinity) { // streaming audio
duration = this.media.seekable.end();
duration = this.media.seekable.end(0);
}
return duration;
},
Expand Down

0 comments on commit c5adffe

Please sign in to comment.