From ac6c0b44dec5a286d2ea79d77ad4a2e2365fab56 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 14 Sep 2020 16:11:18 -0700 Subject: [PATCH] fix: Fix loading with global "define" set to null It seems that some websites have a global "define" object set to null. This caused our module loader to break when Shaka Player was loaded. By checking for "define" to have a "function" type, rather than just being defined at all, we can avoid this problem. Closes #2847 Change-Id: I645f61687b9ec298bcc51c8d128398cdad3dd3b9 --- build/wrapper.template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/wrapper.template.js b/build/wrapper.template.js index 9bc8048984..136dbd8711 100644 --- a/build/wrapper.template.js +++ b/build/wrapper.template.js @@ -39,7 +39,7 @@ for (var k in exportTo.shaka) { exports[k] = exportTo.shaka[k]; } - } else if (typeof define != 'undefined' && define.amd) { + } else if (typeof define == 'function' && define.amd) { // AMD module loader. define(function(){ return exportTo.shaka;