1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

@bcvio fixed returning current source rather than blob url. closes #2833

This commit is contained in:
Violeta Marculescu 2015-11-23 12:04:31 -05:00 committed by Gary Katsevman
parent 3a40b10fa6
commit c0d5f471bc
3 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,7 @@ CHANGELOG
## HEAD (Unreleased)
* @DatTran fixed bower paths. Fixes #2740 ([view](https://github.com/videojs/video.js/pull/2775))
* @nbibler ensured classes begin with alpha characters. Fixes #2828 ([view](https://github.com/videojs/video.js/pull/2829))
* @bcvio fixed returning current source rather than blob url ([view](https://github.com/videojs/video.js/pull/2833))
--------------------

View File

@ -492,7 +492,13 @@ class Html5 extends Tech {
* @return {Object}
* @method currentSrc
*/
currentSrc() { return this.el_.currentSrc; }
currentSrc() {
if (this.currentSource_) {
return this.currentSource_.src;
} else {
return this.el_.currentSrc;
}
}
/**
* Get poster

View File

@ -249,6 +249,12 @@ if (Html5.supportsNativeTextTracks()) {
equal(adds[2][0], rems[2][0], 'removetrack event handler removed');
});
}
test('should always return currentSource_ if set', function(){
let currentSrc = Html5.prototype.currentSrc;
equal(currentSrc.call({el_: {currentSrc:'test1'}}), 'test1', 'sould return source from element if nothing else set');
equal(currentSrc.call({currentSource_:{src: 'test2'}}), 'test2', 'sould return source from currentSource_, if nothing else set');
equal(currentSrc.call({currentSource_:{src: 'test2'}, el_:{currentSrc:'test1'}}), 'test2', 'sould return source from source set, not from element');
});
test('should fire makeup events when a video tag is initialized late', function(){
let lateInit = Html5.prototype.handleLateInit_;