From 26d4e7b0bf0b30c3cd05ad1f5e49e58cf5174f0d Mon Sep 17 00:00:00 2001 From: Pat O'Neill Date: Fri, 23 Dec 2016 14:03:58 -0500 Subject: [PATCH] ignore: Prevent test failures in IE8 (#3891) --- src/js/tech/html5.js | 3 --- src/js/utils/dom.js | 9 ++++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index d71615b14..a6d0d3555 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -1030,9 +1030,6 @@ const mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i; const mp4RE = /^video\/mp4/i; Html5.patchCanPlayType = function() { - if (!canPlayType) { - return; - } // Android 4.0 and above can play HLS to some extent but it reports being unable to do so if (browser.ANDROID_VERSION >= 4.0 && !browser.IS_FIREFOX) { diff --git a/src/js/utils/dom.js b/src/js/utils/dom.js index f96b00932..c8acc075f 100644 --- a/src/js/utils/dom.js +++ b/src/js/utils/dom.js @@ -61,7 +61,14 @@ function classRegExp(className) { * @return {Boolean} */ export function isReal() { - return document === window.document && typeof document.createElement === 'function'; + return ( + + // Both document and window will never be undefined thanks to `global`. + document === window.document && + + // In IE < 9, DOM methods return "object" as their type, so all we can + // confidently check is that it exists. + typeof document.createElement !== 'undefined'); } /**