From a0303969c2c6875790d600444f357b12bdb09b50 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 8 Dec 2018 16:50:44 +1100 Subject: Fix for error when mime type not specified (fixes #1274) --- src/js/support.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/js/support.js') diff --git a/src/js/support.js b/src/js/support.js index 9257df13..81965867 100644 --- a/src/js/support.js +++ b/src/js/support.js @@ -68,9 +68,13 @@ const support = { // Check for mime type support against a player instance // Credits: http://diveintohtml5.info/everything.html // Related: http://www.leanbackplayer.com/test/h5mt.html - mime(inputType) { - const [mediaType] = inputType.split('/'); - let type = inputType; + mime(input) { + if (is.empty(input)) { + return false; + } + + const [mediaType] = input.split('/'); + let type = input; // Verify we're using HTML5 and there's no media type mismatch if (!this.isHTML5 || mediaType !== this.type) { @@ -79,7 +83,7 @@ const support = { // Add codec if required if (Object.keys(defaultCodecs).includes(type)) { - type += `; codecs="${defaultCodecs[inputType]}"`; + type += `; codecs="${defaultCodecs[input]}"`; } try { -- cgit v1.2.3