Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

1.0 KB
Raw Blame
<!doctype html>
<meta charset="utf-8">
<title>Media fixture</title>
<style>body { margin: 0; background: #111; color: #eee; font: 14px system-ui; } video { width: 640px; height: 360px; display: block; }</style>
<!-- A looping H.264/AAC clip (clip.mp4: ffmpeg testsrc2 with a silent AAC track, 4 s; WebKit counts a playing, unmuted track as sound, and a scenario stays quiet) with media
     session handlers, for the sidebar player, Picture in Picture and tab sleep. Paused until a
     scenario plays it with a user gesture. The title says what the page last heard. -->
<div id="player"><video id="v" src="clip.mp4" loop playsinline></video></div>
<p id="state">ready</p>
<script>
  const v = document.getElementById('v');
  const say = s => { document.getElementById('state').textContent = s; document.title = 'Media ' + s; };
  for (const a of ['previoustrack', 'nexttrack']) navigator.mediaSession.setActionHandler(a, () => say(a));
  for (const e of ['play', 'pause', 'enterpictureinpicture', 'leavepictureinpicture']) v.addEventListener(e, () => say(e));
</script>