diff options
author | Sam Potts <sam@potts.es> | 2019-03-16 12:14:20 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-03-16 12:14:20 +1100 |
commit | 35f7ee9c59ff082a5b71aae43ffccab4cdf10fdf (patch) | |
tree | 75b8f7c56ec7fa6696991e52197172c9c6c7c3cd /src/js/html5.js | |
parent | bdd513635fffa33f66735c80209e6ae77e0426b4 (diff) | |
parent | c202551e6d0b11656a99b41f3f8b3a48f2bf1e0a (diff) | |
download | plyr-35f7ee9c59ff082a5b71aae43ffccab4cdf10fdf.tar.lz plyr-35f7ee9c59ff082a5b71aae43ffccab4cdf10fdf.tar.xz plyr-35f7ee9c59ff082a5b71aae43ffccab4cdf10fdf.zip |
Merge branch 'develop' into css-variables
# Conflicts:
# demo/dist/demo.css
# demo/index.html
# dist/plyr.css
# gulpfile.js
# package.json
# yarn.lock
Diffstat (limited to 'src/js/html5.js')
-rw-r--r-- | src/js/html5.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/js/html5.js b/src/js/html5.js index 0876211a..3266a58e 100644 --- a/src/js/html5.js +++ b/src/js/html5.js @@ -5,6 +5,7 @@ import support from './support'; import { removeElement } from './utils/elements'; import { triggerEvent } from './utils/events'; +import is from './utils/is'; const html5 = { getSources() { @@ -14,8 +15,16 @@ const html5 = { const sources = Array.from(this.media.querySelectorAll('source')); - // Filter out unsupported sources - return sources.filter(source => support.mime.call(this, source.getAttribute('type'))); + // Filter out unsupported sources (if type is specified) + return sources.filter(source => { + const type = source.getAttribute('type'); + + if (is.empty(type)) { + return true; + } + + return support.mime.call(this, type); + }); }, // Get quality levels |