From de51411ce53e253b27e059d9fae1f80efb937203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 9 Aug 2021 15:50:18 -0500 Subject: [general]: fix w3c change 'size' to 'data-res' --- demo/error.html | 46 +++--- demo/index.html | 484 +++++++++++++++++++++++++++----------------------------- src/js/html5.js | 6 +- 3 files changed, 261 insertions(+), 275 deletions(-) diff --git a/demo/error.html b/demo/error.html index 93855cca..8e6a156b 100644 --- a/demo/error.html +++ b/demo/error.html @@ -1,31 +1,31 @@ - - - Doh. Looks like something went wrong. - + + + Doh. Looks like something went wrong. + - - - - - + + + + + - - + + - - - - + + + + - -
-

Doh.

-

Looks like something went wrong.

- Go back -
- + +
+

Doh.

+

Looks like something went wrong.

+ Go back +
+ - \ No newline at end of file + diff --git a/demo/index.html b/demo/index.html index 777611d9..13411036 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,268 +1,254 @@ - - - Plyr - A simple, customizable HTML5 Video, Audio, YouTube and Vimeo player - - - + + + Plyr - A simple, customizable HTML5 Video, Audio, YouTube and Vimeo player + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - + + + + - - - - + +
+
+

Player

+

+ A simple, accessible and customisable media player for + , + , + + and + +

- -
-
-

Player

-

- A simple, accessible and customisable media player for - , - , - - and - -

+

+ Premium video monetization from + + ai.vi + ai.vi + +

-

- Premium video monetization from - - ai.vi - ai.vi - -

+ +
+
+
-
-
- +
- - Download - + +
- - - - - + +

+ If you think Plyr's good, + tweet it +

+ - - + + diff --git a/src/js/html5.js b/src/js/html5.js index 0cb5b27a..ab796234 100644 --- a/src/js/html5.js +++ b/src/js/html5.js @@ -39,7 +39,7 @@ const html5 = { // Get sizes from elements return html5.getSources .call(this) - .map((source) => Number(source.getAttribute('size'))) + .map((source) => Number(source.getAttribute('data-res'))) .filter(Boolean); }, @@ -66,7 +66,7 @@ const html5 = { const source = sources.find((s) => s.getAttribute('src') === player.source); // Return size, if match is found - return source && Number(source.getAttribute('size')); + return source && Number(source.getAttribute('data-res')); }, set(input) { if (player.quality === input) { @@ -80,7 +80,7 @@ const html5 = { // Get sources const sources = html5.getSources.call(player); // Get first match for requested size - const source = sources.find((s) => Number(s.getAttribute('size')) === input); + const source = sources.find((s) => Number(s.getAttribute('data-res')) === input); // No matching source found if (!source) { -- cgit v1.2.3