
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
@moq-js/player
Advanced tools
Media over QUIC (MoQ) is a live media delivery protocol utilizing QUIC streams. See the MoQ working group for more information.
This repository provides a web library for MoQ. It uses browser APIs such as WebTransport and WebCodecs to support both contribution and distribution over MoQ.
Note: This library currently focuses on the client side. You’ll need a MoQ server or relay, such as moq-rs (for local usage).
This library offers two main approaches to playing MoQ streams in a browser:
<video-moq> with simple built-in controls.Player class that handles rendering and playback logic without built-in UI.Install the library from npm:
npm install @moq-js/player
Or include via a <script> tag (for the IIFE build):
<script src="https://cdn.jsdelivr.net/npm/@moq-js/player@latest/dist/moq-player.iife.js"></script>
<video-moq><video-moq
src="https://example.com/my-moq-stream?namespace=demo"
fingerprint="https://example.com/fingerprint"
width="640"
muted
controls
></video-moq>
The built-in controls are basic. If you want more advanced controls or custom styling, see the Styling & Media Chrome section or our samples.
If you’d prefer to implement your own UI or integrate the player logic differently, use the class-based Player:
import { Player } from "moq-player";
async function initPlayer() {
const canvas = document.getElementById("my-canvas");
const player = await Player.create({
url: "https://example.com/my-moq-stream",
fingerprint: "https://example.com/fingerprint",
namespace: "demo",
canvas,
});
player.play();
// Implement your own play/pause buttons, volume sliders, etc.
}
Both the Web Component and the Class-Based Player emit a series of events to help track playback state:
playpauseloadeddatavolumechangeunsubscribestaredunsubscribedonesubscribestaredsubscribedonewaitingforkeyframetimeupdateYou can listen to these events in the usual way. For example:
const videoMoq = document.querySelector("video-moq");
videoMoq.addEventListener("play", () => {
console.log("Playback started!");
});
See samples/event-handling for complete examples.
When using the <video-moq> element, you can style it in various ways:
<video-moq> inside a <media-controller> and use <media-play-button>, <media-time-range>, and other controls. See samples/media-chrome for an example.<script type="module" src="https://cdn.jsdelivr.net/npm/media-chrome@4/+esm"></script>
<media-controller>
<video-moq slot="media" src="..." controls></video-moq>
<media-play-button></media-play-button>
<media-mute-button></media-mute-button>
<!-- more controls... -->
</media-controller>
samples/media-chrome for a working example.<script type="module" src="https://cdn.jsdelivr.net/npm/player.style/x-mas/+esm"></script>
<media-theme-x-mas>
<video-moq
src="https://localhost:4443?namespace=bbb"
fingerprint="https://localhost:4443/fingerprint"
width="640px"
slot="media"
></video-moq>
</media-theme-x-mas>
The samples/ directory demonstrates:
<video-moq> usage.<video-moq> with player.style custom themes.npm install
npm run dev
Open localhost:3000 in a browser to see the samples running.
Licensed under either:
FAQs
Media over QUIC library
The npm package @moq-js/player receives a total of 7 weekly downloads. As such, @moq-js/player popularity was classified as not popular.
We found that @moq-js/player demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.