From 9534db823d6231254d5560d97ad3fc0341e24aae Mon Sep 17 00:00:00 2001 From: khrizpv Date: Fri, 31 Jul 2015 10:59:03 -0300 Subject: [PATCH 1/7] Update plyr.scss - Make it work V2! Hi, thanks for accepting my previous pull request. I made this request because the variables control-color and control-color-hover weren't being set inside the mixin so i took them out and it's working now again. I hope you can merge this as it isnt completly working yet and sorry for the delay. Thanks again! :) --- src/sass/plyr.scss | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index bff8cd2e..48acfbd7 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -23,28 +23,21 @@ $font-size-large: ceil(($font-size-base * 1.5)) !default; $control-spacing: 10px !default; $controls-bg: #fff !default; $control-bg-hover: $blue !default; !default +$control-color: null !default; +$control-color-hover: null !default; // Contrast -@mixin contrast-control-color($color: "") { - $control-color: null !global; - @if lightness($color) >= 65% { - $control-color: $gray-light; - } @else if(lightness($color) < 65%) { - $control-color: $gray-lighter; - } +@if lightness($controls-bg) >= 65% { + $control-color: $gray-light; +} @else { + $control-color: $gray-lighter; } -@mixin contrast-control-color-hover($color: "") { - $control-color-hover: null !global; - @if lightness($color) >= 65% { - $control-color-hover: $gray; - } @else if lightness($color) < 65% { - $control-color-hover: #fff; - } +@if lightness($control-bg-hover) >= 65% { + $control-color-hover: $gray; +} @else { + $control-color-hover: #fff; } -@include contrast-control-color($controls-bg); -@include contrast-control-color-hover($control-bg-hover); - // Tooltips $tooltip-bg: $controls-bg !default; $tooltip-color: $control-color !default; From e97b616811ef84fd7caffe758afd43d7b244a32d Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 5 Aug 2015 19:55:30 -0700 Subject: [PATCH 2/7] Fixed events are not fired in YouTube embed player --- src/js/plyr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 593a64b4..d3288287 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -915,7 +915,7 @@ modestbranding: 1 }, events: { - onReady: function(event) { + 'onReady': function(event) { // Get the instance var instance = event.target; @@ -960,7 +960,7 @@ } } }, - onStateChange: function(event) { + 'onStateChange': function(event) { // Get the instance var instance = event.target; From e1353096709a3cabbf56842d9dc2b52d20cd8a9e Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 5 Aug 2015 19:56:16 -0700 Subject: [PATCH 3/7] Fixed youtube video cannot seek before video started with controls --- src/js/plyr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index d3288287..2b1ab613 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1253,7 +1253,7 @@ // YouTube if(player.type == "youtube") { - player.embed.seekTo(player.media.currentTime); + player.embed.seekTo(targetTime); // Trigger timeupdate _triggerEvent(player.media, "timeupdate"); From 5fcfd5fa4f56f657a53de24c20f8522c37241e0d Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 5 Aug 2015 20:09:05 -0700 Subject: [PATCH 4/7] Eliminated running try catch when player.type="youtube" --- src/js/plyr.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 2b1ab613..2bd83343 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1244,15 +1244,16 @@ targetTime = player.media.duration; } - // Set the current time - // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans - try { - player.media.currentTime = targetTime.toFixed(1); - } - catch(e) {} - + // Set the current time + if(player.type == "video" || player.type == "audio") { + // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans + try { + player.media.currentTime = targetTime.toFixed(1); + } + catch(e) {} + } // YouTube - if(player.type == "youtube") { + else if(player.type == "youtube") { player.embed.seekTo(targetTime); // Trigger timeupdate From 9f1e5a55f43eae1d46828d0ea3c5a0396dfd6523 Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 5 Aug 2015 20:33:04 -0700 Subject: [PATCH 5/7] Disabled YouTube embed player keyboard control to match with plyr's control --- src/js/plyr.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 2bd83343..982023bb 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -912,7 +912,8 @@ iv_load_policy: 3, cc_lang_pref: "en", wmode: "transparent", - modestbranding: 1 + modestbranding: 1, + disablekb: 1 }, events: { 'onReady': function(event) { From f983f0771b8c0c2a15e65abc9ebac5cccc2b2bbe Mon Sep 17 00:00:00 2001 From: Calvin Tam Date: Wed, 5 Aug 2015 20:36:48 -0700 Subject: [PATCH 6/7] Revert "Eliminated running try catch when player.type="youtube"" This reverts commit 5fcfd5fa4f56f657a53de24c20f8522c37241e0d. --- src/js/plyr.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 982023bb..782e6397 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1245,16 +1245,15 @@ targetTime = player.media.duration; } - // Set the current time - if(player.type == "video" || player.type == "audio") { - // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans - try { - player.media.currentTime = targetTime.toFixed(1); - } - catch(e) {} - } + // Set the current time + // Try/catch incase the media isn't set and we're calling seek() from source() and IE moans + try { + player.media.currentTime = targetTime.toFixed(1); + } + catch(e) {} + // YouTube - else if(player.type == "youtube") { + if(player.type == "youtube") { player.embed.seekTo(targetTime); // Trigger timeupdate From 75c090e8b9c0e58a73005d315e326e5ac1902860 Mon Sep 17 00:00:00 2001 From: khrizpv Date: Thu, 6 Aug 2015 14:21:36 -0300 Subject: [PATCH 7/7] Update plyr.scss - Make it work V3! --- src/sass/plyr.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss index 48acfbd7..a4dab010 100644 --- a/src/sass/plyr.scss +++ b/src/sass/plyr.scss @@ -22,7 +22,7 @@ $font-size-large: ceil(($font-size-base * 1.5)) !default; // Controls $control-spacing: 10px !default; $controls-bg: #fff !default; -$control-bg-hover: $blue !default; !default +$control-bg-hover: $blue !default; $control-color: null !default; $control-color-hover: null !default; @@ -49,7 +49,7 @@ $tooltip-radius: 3px !default; $progress-bg: rgba(red($gray), green($gray), blue($gray), .2) !default; $progress-playing-bg: $blue !default; $progress-buffered-bg: rgba(red($gray), green($gray), blue($gray), .25) !default; -$progress-loading-size: 40px !default +$progress-loading-size: 40px !default; $progress-loading-bg: rgba(0,0,0, .15) !default; // Volume