Started on error handling, Safari icon fix

This commit is contained in:
Sam Potts
2017-11-14 17:27:40 +01:00
parent 022b436c3f
commit c64b8f6940
11 changed files with 118 additions and 50 deletions

9
src/js/controls.js vendored
View File

@@ -75,14 +75,11 @@ const controls = {
const use = document.createElementNS(namespace, 'use');
const path = `${iconPath}-${type}`;
// If the new `href` attribute is supported, use that
// Set `href` attributes
// https://github.com/sampotts/plyr/issues/460
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
if ('href' in use) {
use.setAttribute('href', path);
} else {
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
}
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
// Add <use> to <svg>
icon.appendChild(use);