mirror of
https://github.com/videojs/video.js.git
synced 2024-11-28 08:58:46 +02:00
@nickygerritsen use the default seekable when a source handler is unset. closes #2401
This commit is contained in:
parent
cb6465e9d2
commit
1d0ae800b8
@ -84,6 +84,7 @@ CHANGELOG
|
||||
* @nickygerritsen scrubbing() is a method, not a property ([view](https://github.com/videojs/video.js/pull/2411))
|
||||
* @sirlancelot change "video" to "media" in error messages ([view](https://github.com/videojs/video.js/pull/2409))
|
||||
* @sirlancelot change "video" to "media" in error messages ([view](https://github.com/videojs/video.js/pull/2409))
|
||||
* @nickygerritsen use the default seekable when a source handler is unset ([view](https://github.com/videojs/video.js/pull/2401))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -538,6 +538,17 @@ Tech.withSourceHandlers = function(_Tech){
|
||||
return '';
|
||||
};
|
||||
|
||||
let originalSeekable = _Tech.prototype.seekable;
|
||||
|
||||
// when a source handler is registered, prefer its implementation of
|
||||
// seekable when present.
|
||||
_Tech.prototype.seekable = function() {
|
||||
if (this.sourceHandler_ && this.sourceHandler_.seekable) {
|
||||
return this.sourceHandler_.seekable();
|
||||
}
|
||||
return originalSeekable.call(this);
|
||||
};
|
||||
|
||||
/*
|
||||
* Create a function for setting the source using a source object
|
||||
* and source handlers.
|
||||
@ -566,16 +577,6 @@ Tech.withSourceHandlers = function(_Tech){
|
||||
this.sourceHandler_ = sh.handleSource(source, this);
|
||||
this.on('dispose', this.disposeSourceHandler);
|
||||
|
||||
this.originalSeekable_ = this.seekable;
|
||||
// when a source handler is registered, prefer its implementation of
|
||||
// seekable when present.
|
||||
this.seekable = function() {
|
||||
if (this.sourceHandler_ && this.sourceHandler_.seekable) {
|
||||
return this.sourceHandler_.seekable();
|
||||
}
|
||||
return this.originalSeekable_.call(this);
|
||||
};
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
@ -585,7 +586,6 @@ Tech.withSourceHandlers = function(_Tech){
|
||||
_Tech.prototype.disposeSourceHandler = function(){
|
||||
if (this.sourceHandler_ && this.sourceHandler_.dispose) {
|
||||
this.sourceHandler_.dispose();
|
||||
this.seekable = this.originalSeekable_;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user