From 542095f5eb9f2d81e9d0ff533529d7b08a1a07e1 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Tue, 24 Oct 2017 05:51:27 +0200 Subject: [PATCH 1/2] Add instanceof wrapper that avoids TypeError when second argument is undefined --- src/js/plyr.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index 59e8c8ef..a563e345 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -373,10 +373,10 @@ return input !== null && input instanceof Event; }, cue: function(input) { - return input !== null && (input instanceof window.TextTrackCue || input instanceof window.VTTCue); + this.instanceOf(input, window.TextTrackCue) || this.instanceOf(input, window.VTTCue); }, track: function(input) { - return input !== null && (input instanceof window.TextTrack || typeof input.kind === 'string'); + return input !== null && (this.instanceOf(input, window.TextTrack) || typeof input.kind === 'string'); }, undefined: function(input) { return input !== null && typeof input === 'undefined'; @@ -389,6 +389,9 @@ (this.object(input) && Object.keys(input).length === 0) ); }, + instanceOf: function(input, constructor) { + return Boolean(input && constructor && input instanceof constructor); + }, }, // Credits: http://paypal.github.io/accessible-html5-video-player/ From 0715d3ae67e60adcb8ec839bfe0d58c926964d31 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Wed, 25 Oct 2017 14:25:10 +0200 Subject: [PATCH 2/2] Restore up/down arrow behavior from v2 (10 steps between min and max instead of one) --- 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 59e8c8ef..5639933c 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -4100,12 +4100,12 @@ case 38: // Arrow up - player.increaseVolume(); + player.increaseVolume(0.1); break; case 40: // Arrow down - player.decreaseVolume(); + player.decreaseVolume(0.1); break; case 77: