Skip to content

[Feature]: Admin Playback Mirror via API #20

@mophawka

Description

@mophawka

💡 Feature Description

Add an Admin Playback Mirror module to WSD that allows an authorized admin to mirror a user’s current playback session directly in-browser.

This feature provides a secure way to observe real-time user playback, useful for diagnostics, education environments, helpdesk monitoring, or multi-user household oversight.


📈 Motivation and Context

While WSD can track sessions, it currently lacks the ability to visually mirror what a user is watching. This is especially useful for:

  • 🔍 Troubleshooting playback issues
  • 👨‍🏫 Educational and compliance monitoring
  • 🛠️ Support team diagnostics
  • 🏡 Family/parental oversight tools

Inspired by workflows found nowhere else but WSD if not Luke'd, this feature makes user session playback observable from a read-only view without interfering with playback or session state.


🛠️ Suggested Implementation (if known)

Example Flow

  1. Detect Active Session
GET /emby/Sessions?activeWithinSeconds=120
X-Emby-Token: {AdminToken}

→ Parse:

  • NowPlayingItem.Id
  • NowPlayingItem.MediaSources[0].Id
  • PlayState.PositionTicks
  1. Generate Playback URL
GET /emby/Videos/{ItemId}/master.m3u8
  ?MediaSourceId={MediaSourceId}
  &DeviceId=admin-mirror-{unique}
  &StartTimeTicks={PositionTicks}
  &Token={AdminToken}
  1. Embed Playback
  • Stream result in <video> element using native or hls.js player

Minimal Player Example

<video id="v" controls autoplay></video>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script>
  const m3u8 = "https://server/emby/Videos/{ItemId}/master.m3u8"
             + "?MediaSourceId={MediaSourceId}"
             + "&DeviceId=admin-window"
             + "&StartTimeTicks={PositionTicks}"
             + "&Token={AdminToken}";
  const video = document.getElementById('v');
  if (video.canPlayType('application/vnd.apple.mpegurl')) video.src = m3u8;
  else if (Hls.isSupported()) { const hls = new Hls(); hls.loadSource(m3u8); hls.attachMedia(video); }
</script>

🖼️ Visuals or References (optional)

  • Mirroring via Emby’s undocumented endpoints currently works but is not officially supported
  • Admin-facing “Viewer Window” could show playback state, device metadata, etc.
  • Works well alongside Watch Statistics and Signal-based Alerts FRs

🔗 Related Issues or Discussions


🧩 Additional Notes

  • 🛡️ Security

    • Playback URLs must be token-gated
    • Only admin tokens allowed
    • Consider short-lived signed URLs or time-bound tokens
  • 🔁 Session Sync

    • Poll session data periodically to refresh position / stream
    • Optionally display desync alert if stream lags behind session state
  • 🧰 Debugging

    • Allow admin to copy stream metadata (codec, bitrate, etc AKA Nerd Stats)
    • Combine with stream performance graphs for diagnosis

Postscript: Since these features are entirely out of scope of QuickBox, and the very generous addition of WSD, they should be considered advanced and placed behind a paywall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions