From 5b0a76953aef62ff8bcadf5c667fbd41c0f90b6e Mon Sep 17 00:00:00 2001 From: Paul Ellis Date: Thu, 7 Apr 2022 23:05:18 -0700 Subject: [PATCH] v2.2.7: Pre-rendered server-side thumbnails * Added ability to use pre-rendered server-side thumbnail files * Dropped EdgeHTML support * Updated to folder.api v1.0.3 - minor date metadata bug --- README.md | 32 +++++-- src/player.html | 121 ++++++++++++++++--------- videos/prerendered-thumbnail-gif.gif | Bin 0 -> 2459 bytes videos/prerendered-thumbnail-gif.mp4 | 0 videos/prerendered-thumbnail-jpeg.jpeg | Bin 0 -> 3299 bytes videos/prerendered-thumbnail-jpeg.mp4 | 0 videos/prerendered-thumbnail-jpg.jpg | Bin 0 -> 3606 bytes videos/prerendered-thumbnail-jpg.mp4 | 0 videos/prerendered-thumbnail-png.mp4 | 0 videos/prerendered-thumbnail-png.png | Bin 0 -> 2928 bytes videos/prerendered-thumbnail-webp.mp4 | 0 videos/prerendered-thumbnail-webp.webp | Bin 0 -> 2510 bytes 12 files changed, 103 insertions(+), 50 deletions(-) create mode 100644 videos/prerendered-thumbnail-gif.gif create mode 100644 videos/prerendered-thumbnail-gif.mp4 create mode 100644 videos/prerendered-thumbnail-jpeg.jpeg create mode 100644 videos/prerendered-thumbnail-jpeg.mp4 create mode 100644 videos/prerendered-thumbnail-jpg.jpg create mode 100644 videos/prerendered-thumbnail-jpg.mp4 create mode 100644 videos/prerendered-thumbnail-png.mp4 create mode 100644 videos/prerendered-thumbnail-png.png create mode 100644 videos/prerendered-thumbnail-webp.mp4 create mode 100644 videos/prerendered-thumbnail-webp.webp diff --git a/README.md b/README.md index 2db54ee..af72182 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ To use it, copy the [`./src/player.html`](src/player.html) file into a folder th * Custom video playback controls (fullscreen, play, pause, mute, etc, volume, playback rate) * Picture-in-picture support * Progress bar with timestamp preview thumbnail on hover -* Video thumbnail generation, with concurrency configuration (default 1)* +* Video thumbnails: [using prerendered thumbnail files](#thumbnails), or rendered on-the-fly in-browser * Animated thumbnails** * Thumbnail caching using `localStorage`, check cache size, clear cache * Select your own custom theme color @@ -34,19 +34,37 @@ To use it, copy the [`./src/player.html`](src/player.html) file into a folder th \** Animated thumbnails can consume a lot of data. The experience may degrade on slower network connections -## Supported Browsers + +## Pre-rendered server-side thumbnails + +`player.html` can use server-side thumbnails for any video that has one available. It will fall back to generating thumbnails in the browser otherwise. The server-side thumbnail files must follow the common filename convention of using the video file name, with the extension replaced with an image extension, in the same folder as the video. Note: The image files must be shown by your web server's directory browsing (may require mime-type adjustments on some servers) feature to show up in `player.html`. + +### Naming example: + +* Video filename: `myVideo.mp4` +* Matching thumbnail filename: `myVideo.jpg` + +### How to pre-render thumbnails + +The easiest way to create thumbnails from video files is on the command-line with [`ffmpeg`](https://ffmpeg.org/). The following command will create a JPEG thumbnail (`myVideo.jpg`) from the video frame 5 seconds into `myVideo.mp4`: `ffmpeg -i myVideo.mp4 -ss 00:00:05.000 -vframes 1 myVideo.jpg`. Loop over folders of video files using your preferred shell (bash, cmd, powershell, etc) to process many videos. + +### Supported thumbnail image formats/extensions +* GIF +* JPEG +* JPG +* PNG +* WEBP + +## Supported browsers The latest version of these browsers is supported: * Edge (Chromium) -* Edge (Xbox EdgeHTML)† * Firefox * Safari (Mac, iPadOS, iOS) * Chrome -† Deprecated: EdgeHTML is only supported on Xbox as it has been replaced on Windows 10. - -## Supported Web Servers +## Supported web servers The latest version of these web servers (others may work as well): @@ -63,4 +81,4 @@ The latest version of these web servers (others may work as well): * [MIT](./LICENSE) -© 2021 Paul Ellis +© 2022 Paul Ellis diff --git a/src/player.html b/src/player.html index 8daa8bb..2a62127 100644 --- a/src/player.html +++ b/src/player.html @@ -4,7 +4,7 @@ player.html - + @@ -2036,11 +2036,11 @@