c010d49b by jrivera

readyState is a function not a getter; only call once on 'canplay' to avoid mult…

…iple the possibility of triggering seek multiple times.
1 parent 2286959f
...@@ -165,7 +165,7 @@ videojs.HlsHandler.prototype.src = function(src) { ...@@ -165,7 +165,7 @@ videojs.HlsHandler.prototype.src = function(src) {
165 } 165 }
166 this.playlists = new videojs.Hls.PlaylistLoader(this.source_.src, this.options_.withCredentials); 166 this.playlists = new videojs.Hls.PlaylistLoader(this.source_.src, this.options_.withCredentials);
167 167
168 this.tech_.on('canplay', this.setupFirstPlay.bind(this)); 168 this.tech_.one('canplay', this.setupFirstPlay.bind(this));
169 169
170 this.playlists.on('loadedmetadata', function() { 170 this.playlists.on('loadedmetadata', function() {
171 oldMediaPlaylist = this.playlists.media(); 171 oldMediaPlaylist = this.playlists.media();
...@@ -428,7 +428,7 @@ videojs.HlsHandler.prototype.setupFirstPlay = function() { ...@@ -428,7 +428,7 @@ videojs.HlsHandler.prototype.setupFirstPlay = function() {
428 428
429 // 5) the video element or flash player is in a readyState of 429 // 5) the video element or flash player is in a readyState of
430 // at least HAVE_FUTURE_DATA 430 // at least HAVE_FUTURE_DATA
431 this.tech_.readyState >= 3) { 431 this.tech_.readyState() >= 1) {
432 432
433 // seek to the latest media position for live videos 433 // seek to the latest media position for live videos
434 seekable = this.seekable(); 434 seekable = this.seekable();
......