aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index 7df41371..fa2d6509 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -78,8 +78,11 @@ const controls = {
// Set `href` attributes
// https://github.com/sampotts/plyr/issues/460
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
- use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
- use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
+ if ('href' in use) {
+ use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
+ } else {
+ use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
+ }
// Add <use> to <svg>
icon.appendChild(use);
@@ -490,7 +493,7 @@ const controls = {
controls.getLabel.call(this, 'quality', quality),
getBadge(quality)
)
- );
+ );
controls.updateSetting.call(this, type, list);
},
@@ -729,7 +732,7 @@ const controls = {
// Create items
this.options.speed.forEach(speed =>
controls.createMenuItem.call(this, speed, list, type, controls.getLabel.call(this, 'speed', speed))
- );
+ );
controls.updateSetting.call(this, type, list);
},