From 38a206892b4869782cd0391307c7610cfe580286 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 8 Aug 2015 14:37:12 +1000 Subject: YouTube, Captions and Control improvements - Controls improvements (Fixes #103) - YouTube bug fixes (Fixes #105) - Internationalization support (Fixes #101) - Captions legibility improvements --- src/js/plyr.js | 145 ++++++++++++++++++++++++++++++----------------------- src/less/plyr.less | 106 ++++++++++++++++++--------------------- src/sass/plyr.scss | 110 ++++++++++++++++++---------------------- 3 files changed, 181 insertions(+), 180 deletions(-) (limited to 'src') diff --git a/src/js/plyr.js b/src/js/plyr.js index 782e6397..a94d67ed 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v1.2.6 +// plyr.js v1.3.0 // https://github.com/selz/plyr // License: The MIT License (MIT) // ========================================================================== @@ -83,7 +83,21 @@ key: "plyr_volume" }, controls: ["restart", "rewind", "play", "fast-forward", "current-time", "duration", "mute", "volume", "captions", "fullscreen"], - onSetup: function() {} + i18n: { + restart: "Restart", + rewind: "Rewind {seektime} secs", + play: "Play", + pause: "Pause", + forward: "Forward {seektime} secs", + played: "played", + buffered: "buffered", + currentTime: "Current time", + duration: "Duration", + volume: "Volume", + toggleMute: "Toggle Mute", + toggleCaptions: "Toggle Captions", + toggleFullscreen: "Toggle Fullscreen" + } }; // Build the default HTML @@ -95,10 +109,10 @@ "", "", "", - "0% played", + "0% " + config.i18n.played, "", "", - "0% buffered", + "0% " + config.i18n.buffered, "", "", ""]; @@ -108,7 +122,7 @@ html.push( "" ); } @@ -118,7 +132,7 @@ html.push( "" ); } @@ -128,11 +142,11 @@ html.push( "", "" ); } @@ -142,7 +156,7 @@ html.push( "" ); } @@ -151,7 +165,7 @@ if(_inArray(config.controls, "current-time")) { html.push( "", - "Current time", + "" + config.i18n.currentTime + "", "00:00", "" ); @@ -161,7 +175,7 @@ if(_inArray(config.controls, "duration")) { html.push( "", - "Duration", + "" + config.i18n.duration + "", "00:00", "" ); @@ -176,19 +190,18 @@ // Toggle mute button if(_inArray(config.controls, "mute")) { html.push( - "", - "