mirror of
https://github.com/videojs/video.js.git
synced 2024-11-26 08:51:09 +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:
parent
e2a1cac136
commit
e39557e790
@ -304,11 +304,9 @@ vjs.Html5.canControlVolume = function(){
|
||||
|
||||
vjs.Html5.unpatchCanPlayType = function() {
|
||||
var r = vjs.TEST_VID.constructor.prototype.canPlayType;
|
||||
if (canPlayType) {
|
||||
vjs.TEST_VID.constructor.prototype.canPlayType = canPlayType;
|
||||
canPlayType = null;
|
||||
return r;
|
||||
}
|
||||
vjs.TEST_VID.constructor.prototype.canPlayType = canPlayType;
|
||||
canPlayType = null;
|
||||
return r;
|
||||
};
|
||||
|
||||
// by default, patch the video element
|
||||
|
@ -59,10 +59,8 @@ test('patchCanPlayType patches canplaytype with our function, conditionally', fu
|
||||
patchedCanPlayType = video.canPlayType;
|
||||
unpatchedCanPlayType = vjs.Html5.unpatchCanPlayType();
|
||||
|
||||
if (canPlayType) {
|
||||
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(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');
|
||||
|
||||
vjs.ANDROID_VERSION = oldAV;
|
||||
vjs.Html5.unpatchCanPlayType();
|
||||
|
Loading…
Reference in New Issue
Block a user