diff mrjunejune/test/snapshots/tools_hls_player.snapshot @ 242:543df0fe7168

[tools] Add full HLS player support
author MrJuneJune <me@mrjunejune.com>
date Mon, 03 Aug 2026 13:14:41 -0700
parents
children 30c2196d03d4
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/snapshots/tools_hls_player.snapshot	Mon Aug 03 13:14:41 2026 -0700
@@ -0,0 +1,257 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<meta name="theme-color" content="#544e43">
+<link rel="icon" type="image/svg+xml" href="/public/epi_all_colors.svg">
+<link rel="manifest" href="/public/manifest.json">
+<link rel="apple-touch-icon" href="/public/epi_all_colors.svg">
+
+<link rel="preload" href="/public/fonts/Roboto-Regular.ttf" as="font"  crossorigin>
+<link rel="preload" href="/public/fonts/Roboto-Thin.ttf"as="font" crossorigin>
+
+<!-- <link rel="preload" href="/public/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin> -->
+<!-- <link rel="preload" href="/public/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin> -->
+
+<!-- <link rel="preload" href="/public/fonts/more-sugar.extras.otf" as="font" type="font/otf" crossorigin> -->
+<link rel="preload" href="/public/fonts/more-sugar.regular.otf" as="font" type="font/otf" crossorigin>
+<link rel="preload" href="/public/fonts/more-sugar.thin.otf" as="font" type="font/otf" crossorigin>
+<link rel="preload" href="/public/epi_all_colors.svg" as="image">
+
+<link rel="preload" href="/base.css" as="style" />
+<link rel="stylesheet" href="/base.css" />
+
+<script src="/public/pwa-register.js" defer></script>
+
+
+    <title>HLS Player - MrJuneJune</title>
+    <link rel="stylesheet" href="/tools/hls_player/index.css" />
+    <script src="/public/hls.min.js" defer></script>
+    <script src="/tools/hls_player/hls-player.js" defer></script>
+  </head>
+  <body>
+    <style>
+  :root {
+    --header-background: var(--white);
+    --header-color: rgb(var(--black));
+    --link-hover-accent: var(--awesome);
+  }
+
+  /* Fixed icon in top left corner */
+  #themeToggle {
+    position: fixed;
+    top: 20px;
+    left: 20px;
+    background: var(--header-background);
+    display: flex;
+    align-items: center;
+    border-radius: 50%;
+    cursor: pointer;
+    z-index: 1000;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+    transition: transform 0.2s ease;
+  }
+
+  #themeToggle:hover {
+    transform: scale(1.05);
+  }
+
+  /* Professional header */
+  header {
+    margin: auto;
+    padding: 1.5em 1em;
+    font-family: "More", sans-serif;
+    box-shadow: 0 2px 8px rgba(var(--black), 5%);
+    width: 720px;
+    max-width: calc(100% - 2em);
+    text-align: center;
+  }
+
+  header h1 {
+    margin: 0;
+    font-size: 1.8em;
+    font-weight: 700;
+    letter-spacing: -0.5px;
+  }
+
+  header h1 a {
+    text-decoration: none;
+    color: var(--header-color);
+  }
+
+  header h1 a::before {
+    display: none;
+  }
+
+  /* Mobile responsiveness */
+  @media (max-width: 720px) {
+    #themeToggle {
+      top: 15px;
+      left: 15px;
+    }
+
+    header {
+      padding: 1em;
+    }
+
+    header h1 {
+      font-size: 1.5em;
+    }
+  }
+
+  @media (max-width: 480px) {
+    #themeToggle {
+      top: 10px;
+      left: 10px;
+    }
+
+    #themeToggle img {
+      height: 40px;
+      width: 40px;
+    }
+
+    header h1 {
+      font-size: 1.3em;
+    }
+  }
+
+  #logo {
+    width: 300px;
+  }
+
+  /* 1. DEFINE THE DEFAULTS (Light Mode) */
+  :root {
+    --logo-invert: invert(0);
+    --epi-grayscale: grayscale(0) brightness(1);
+  }
+  
+  /* 2. MANUAL DARK OVERRIDE */
+  html.dark {
+    --logo-invert: invert(1);
+    --epi-grayscale: grayscale(1);
+  }
+  
+  /* 3. MANUAL LIGHT OVERRIDE */
+  html.light-mode {
+    --logo-invert: invert(0);
+    --epi-grayscale: brightness(2.9) grayscale(1);
+  }
+  
+  /* 4. SYSTEM PREFERENCE */
+  @media (prefers-color-scheme: dark) {
+    :root:not(.light-mode) {
+      --logo-invert: invert(1);
+    }
+  }
+  
+  /* 5. APPLY TO ELEMENTS */
+  #logo {
+    -webkit-filter: var(--logo-invert);
+    filter: var(--logo-invert);
+    transition: filter 0.3s ease;
+  }
+  
+  .epi-logo {
+    -webkit-filter: var(--epi-grayscale);
+    filter: var(--epi-grayscale);
+    transition: filter 0.3s ease;
+  }
+</style>
+
+<div id="themeToggle">
+  <img id="epiChan" class="epi-logo" aria-label="Toggle dark mode" src="/public/epi_all_colors.svg" height="50" width="50">
+</div>
+
+<header>
+  <h1><a href="/">MrJuneJune</a></h1>
+</header>
+<script src="/index.js"></script>
+
+
+    <main>
+      <h1>Online HLS Player</h1>
+      <p>Load an HLS playlist from a URL, or try the sample stream bundled with this site.</p>
+
+      <form id="hlsForm" class="hls-form">
+        <label for="hlsUrl">Playlist URL</label>
+        <div class="hls-url-row">
+          <input
+            id="hlsUrl"
+            name="url"
+            type="text"
+            inputmode="url"
+            value="/public/hls-sample/h264-ts-stream.m3u8"
+            placeholder="https://example.com/stream.m3u8"
+            required
+          />
+          <button type="submit">Load</button>
+          <button id="sampleButton" type="button">Sample</button>
+        </div>
+      </form>
+
+      <fieldset class="hls-local-picker">
+        <legend>Local HLS</legend>
+        <p>Select the playlist together with every init and segment file it references.</p>
+        <div class="hls-local-actions">
+          <label class="hls-file-button">
+            Choose HLS files
+            <input
+              id="hlsFiles"
+              type="file"
+              accept=".m3u8,.m4s,.mp4,.ts,.aac,.vtt,.key,application/vnd.apple.mpegurl"
+              multiple
+            />
+          </label>
+          <label class="hls-file-button">
+            Choose HLS folder
+            <input
+              id="hlsFolder"
+              type="file"
+              webkitdirectory
+              multiple
+            />
+          </label>
+        </div>
+      </fieldset>
+
+      <div class="hls-player-shell">
+        <video id="hlsVideo" controls playsinline preload="metadata"></video>
+        <p id="hlsStatus" class="hls-status" role="status" aria-live="polite">Ready to load a playlist.</p>
+      </div>
+
+      <dl id="hlsDetails" class="hls-details" hidden>
+        <div>
+          <dt>Playback</dt>
+          <dd data-detail="mode">-</dd>
+        </div>
+        <div>
+          <dt>Segments</dt>
+          <dd data-detail="segments">-</dd>
+        </div>
+        <div>
+          <dt>Duration</dt>
+          <dd data-detail="duration">-</dd>
+        </div>
+        <div>
+          <dt>Codec</dt>
+          <dd data-detail="codecs">-</dd>
+        </div>
+      </dl>
+
+      <section class="hls-notes">
+        <h2>Notes</h2>
+        <ul>
+          <li>Remote playlists must allow cross-origin requests.</li>
+          <li>Local loading stays in your browser; selected files are not uploaded.</li>
+          <li>Chrome, Edge, and Firefox support MPEG-TS, fragmented MP4, live, and adaptive HLS through hls.js.</li>
+          <li>Safari uses native HLS playback when available.</li>
+        </ul>
+      </section>
+    </main>
+    <div style="display: flex; align-items: center; justify-content: center; margin: 30px 0px;">
+  <small>&copy; 2026 June Park</small>
+</div>
+
+  </body>
+</html>