mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
Always unpatch canPlayType.
Fix up tests to not ignore some if canPlayType is not available since unpatch is no longer broken.
This commit is contained in:
@ -304,11 +304,9 @@ vjs.Html5.canControlVolume = function(){
|
|||||||
|
|
||||||
vjs.Html5.unpatchCanPlayType = function() {
|
vjs.Html5.unpatchCanPlayType = function() {
|
||||||
var r = vjs.TEST_VID.constructor.prototype.canPlayType;
|
var r = vjs.TEST_VID.constructor.prototype.canPlayType;
|
||||||
if (canPlayType) {
|
|
||||||
vjs.TEST_VID.constructor.prototype.canPlayType = canPlayType;
|
vjs.TEST_VID.constructor.prototype.canPlayType = canPlayType;
|
||||||
canPlayType = null;
|
canPlayType = null;
|
||||||
return r;
|
return r;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// by default, patch the video element
|
// by default, patch the video element
|
||||||
|
@ -59,10 +59,8 @@ test('patchCanPlayType patches canplaytype with our function, conditionally', fu
|
|||||||
patchedCanPlayType = video.canPlayType;
|
patchedCanPlayType = video.canPlayType;
|
||||||
unpatchedCanPlayType = vjs.Html5.unpatchCanPlayType();
|
unpatchedCanPlayType = vjs.Html5.unpatchCanPlayType();
|
||||||
|
|
||||||
if (canPlayType) {
|
|
||||||
strictEqual(canPlayType, vjs.TEST_VID.constructor.prototype.canPlayType, 'original canPlayType and unpatched canPlayType should be equal');
|
strictEqual(canPlayType, vjs.TEST_VID.constructor.prototype.canPlayType, 'original canPlayType and unpatched canPlayType should be equal');
|
||||||
strictEqual(patchedCanPlayType, unpatchedCanPlayType, 'patched canPlayType and function returned from unpatch are equal');
|
strictEqual(patchedCanPlayType, unpatchedCanPlayType, 'patched canPlayType and function returned from unpatch are equal');
|
||||||
}
|
|
||||||
|
|
||||||
vjs.ANDROID_VERSION = oldAV;
|
vjs.ANDROID_VERSION = oldAV;
|
||||||
vjs.Html5.unpatchCanPlayType();
|
vjs.Html5.unpatchCanPlayType();
|
||||||
|
Reference in New Issue
Block a user