From 11fed8d1b5ec9bfcbeafa0a90ebbc0ac15711807 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 27 Feb 2019 15:43:36 +0100 Subject: Preview seek: fix: allow absolute thumbnail paths --- src/js/plugins/previewThumbnails.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/js/plugins') diff --git a/src/js/plugins/previewThumbnails.js b/src/js/plugins/previewThumbnails.js index bd7a6bbd..90e6226d 100644 --- a/src/js/plugins/previewThumbnails.js +++ b/src/js/plugins/previewThumbnails.js @@ -148,7 +148,10 @@ class PreviewThumbnails { // If the URLs don't start with '/', then we need to set their relative path to be the location of the VTT file // If the URLs do start with '/', then they obviously don't need a prefix, so it will remain blank - if (!thumbnail.frames[0].text.startsWith('/')) { + // If the thumbnail URLs start with with none of '/', 'http://' or 'https://', then we need to set their relative path to be the location of the VTT file + if (!thumbnail.frames[0].text.startsWith('/') && + !thumbnail.frames[0].text.startsWith('http://') && + !thumbnail.frames[0].text.startsWith('https://')) { thumbnail.urlPrefix = url.substring(0, url.lastIndexOf('/') + 1); } -- cgit v1.2.3 From ce91945544b51da0a3546367b5a41da3ccbd1eeb Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 27 Feb 2019 15:45:24 +0100 Subject: Preview seek: optional hours and ms in VTT parser --- src/js/plugins/previewThumbnails.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/js/plugins') diff --git a/src/js/plugins/previewThumbnails.js b/src/js/plugins/previewThumbnails.js index 90e6226d..813bc47e 100644 --- a/src/js/plugins/previewThumbnails.js +++ b/src/js/plugins/previewThumbnails.js @@ -17,17 +17,17 @@ const parseVtt = vttDataString => { if (!is.number(result.startTime)) { // The line with start and end times on it is the first line of interest const matchTimes = line.match( - /([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{2,3})/, + /([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/, ); // Note that this currently ignores caption formatting directives that are optionally on the end of this line - fine for non-captions VTT if (matchTimes) { result.startTime = - Number(matchTimes[1]) * 60 * 60 + + Number(matchTimes[1] || 0) * 60 * 60 + Number(matchTimes[2]) * 60 + Number(matchTimes[3]) + Number(`0.${matchTimes[4]}`); result.endTime = - Number(matchTimes[6]) * 60 * 60 + + Number(matchTimes[6] || 0) * 60 * 60 + Number(matchTimes[7]) * 60 + Number(matchTimes[8]) + Number(`0.${matchTimes[9]}`); -- cgit v1.2.3 From 2eccf0dd05f1678749a2c10c84e5c2bff03f1435 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 12 Apr 2019 12:13:46 +1000 Subject: Fix YouTube autoplay (fixes #1185) --- src/js/plugins/youtube.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/plugins') diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index d5972c80..3e73a4d0 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -386,7 +386,7 @@ const youtube = { case 1: // Restore paused state (YouTube starts playing on seek if the video hasn't been played yet) - if (player.media.paused && !player.embed.hasPlayed) { + if (!player.config.autoplay && player.media.paused && !player.embed.hasPlayed) { player.media.pause(); } else { assurePlaybackState.call(player, true); -- cgit v1.2.3 From b247093495c3402dbe7c14e3faeff8475f4e277c Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 12 Apr 2019 12:19:48 +1000 Subject: Aspect ratio improvements (fixes #1042, fixes #1366) --- src/js/plugins/vimeo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/js/plugins') diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index a7664e73..9d6c1665 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -282,7 +282,7 @@ const vimeo = { Promise.all([player.embed.getVideoWidth(), player.embed.getVideoHeight()]).then(dimensions => { const [width, height] = dimensions; player.embed.ratio = `${width}:${height}`; - setAspectRatio.call(this, player.embed.ratio); + setAspectRatio.call(this); }); // Set autopause -- cgit v1.2.3