1
0
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:
Gary Katsevman 2014-03-26 16:59:04 -04:00
parent e2a1cac136
commit e39557e790
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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();