app
Adom Video Player
Public Made by Adomby adom
Show any video in a real player: seek, scrub, frame step, chapters. One command, no hand-rolled servers.
← Commit history
Publish 0.4.5
4 files changed
+9−9
package.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-video-player", "type": "app",- "version": "0.4.4",+ "version": "0.4.5", "title": "Adom Video Player", "brief": "Show any video in a real player: seek, scrub, frame step, chapters. One command, no hand-rolled servers.", "summary": "When an AI shows you a video or audio file, it plays here: a shared server that answers HTTP Range requests, so the timeline seeks, in the same YouTube-style player as the wiki's ::adom-video widget, with YouTube's shortcuts, chapters, captions, frame stepping and auto-reload when the file is re-rendered.",
page.json+1−1@@ -1,7 +1,7 @@ { "slug": "adom-video-player", "type": "app",- "version": "0.4.4",+ "version": "0.4.5", "title": "Adom Video Player", "brief": "Show any video in a real player: seek, scrub, frame step, chapters. One command, no hand-rolled servers.", "summary": "When an AI shows you a video or audio file, it plays here: a shared server that answers HTTP Range requests, so the timeline seeks, in the same YouTube-style player as the wiki's ::adom-video widget, with YouTube's shortcuts, chapters, captions, frame stepping and auto-reload when the file is re-rendered.",
public/adom-video.js+6−6@@ -87,7 +87,7 @@ const SHORTCUTS = [ ['Play / pause', 'Space or K'], ['Back 10 s / forward 10 s', 'J / L'], ['Back 5 s / forward 5 s', '← / →'], ['Volume up / down', '↑ / ↓'], ['Mute', 'M'], ['Jump to 0% to 90%', '0 to 9'], ['Start / end', 'Home / End'],- ['Previous / next frame (pauses)', ', / .'], ['Slower / faster (0.25x to 4x)', '< / >'], ['2x while held', 'Hold the mouse on the video'],+ ['Previous / next frame (while paused)', ', / .'], ['Slower / faster (0.25x to 4x)', '< / >'], ['2x while held', 'Hold the mouse on the video'], ['Previous / next chapter', 'Ctrl + ← / →'], ['Previous / next video on the page', 'Shift + P / Shift + N'], ['Captions on / off', 'C'], ['Caption size', '+ / −'], ['Caption text opacity', 'O'], ['Caption background opacity', 'W'], ['Fullscreen', 'F or double-click'], ['Open large in a new tab', 'T'], ['Picture-in-picture', 'I'], ['Close menu / exit', 'Esc'],@@ -544,7 +544,7 @@ // one frame at the video's measured frame rate (default 30 fps), landing mid-frame so rounding never repeats one frame(n) { const v = this.v, f = this._fdt || 1 / 30;- if (!v.paused) v.pause();+ if (!v.paused) return; const k = Math.floor(v.currentTime / f + 0.02) + n; v.currentTime = clamp((k + 0.5) * f, 0, v.duration || 0); this._started(); this._show();@@ -943,10 +943,10 @@ else if (k === 'ArrowRight') this.seekBy(5, true); else if (k === 'ArrowUp') this.volBy(0.05); else if (k === 'ArrowDown') this.volBy(-0.05);- else if (k === ',') this.frame(-1);- else if (k === '.') this.frame(1);- else if (k === '<') this.speedStep(-1);- else if (k === '>') this.speedStep(1);+ else if (k === '<' || (k === ',' && e.shiftKey)) this.speedStep(-1);+ else if (k === '>' || (k === '.' && e.shiftKey)) this.speedStep(1);+ else if (k === ',' && v.paused) this.frame(-1);+ else if (k === '.' && v.paused) this.frame(1); else if (k === 'Home') this.seekTo(0); else if (k === 'End') this.seekTo(v.duration || 0); else if (/^[0-9]$/.test(k)) this.seekTo((v.duration || 0) * Number(k) / 10);
public/player.html+1−1@@ -39,7 +39,7 @@ <tr><td>M</td><td>Mute or unmute</td></tr> <tr><td>0 to 9</td><td>Jump to 0% to 90%</td></tr> <tr><td>Home / End</td><td>Start or end</td></tr>- <tr><td>, / .</td><td>Previous or next frame (pauses)</td></tr>+ <tr><td>, / .</td><td>Previous or next frame (while paused)</td></tr> <tr><td>< / ></td><td>Slower or faster (0.25x to 4x)</td></tr> <tr><td>Hold the mouse</td><td>2x while held on the video</td></tr> <tr><td>Ctrl+← / Ctrl+→</td><td>Previous or next chapter</td></tr>