0.6.0 • Published 6 months ago

@kixelated/moq v0.6.0

Weekly downloads
-
License
(MIT OR Apache-2....
Repository
github
Last release
6 months ago

Media over QUIC (MoQ) is a live (media) delivery protocol utilizing QUIC. It utilizes new browser technologies such as WebTransport and WebCodecs to provide WebRTC-like functionality. Despite the focus on media, the transport is generic and designed to scale to enormous viewership via clustered relay servers (aka a CDN). See quic.video for more information.

Note: this project is a fork of the IETF specification. The principles are the same but the implementation is exponentially simpler given a narrower focus (and no politics).

Usage

This library contains just the generic transport. More documentation will be available later, until then refer to the code.

import * as Moq from "@kixelated/moq";

const conn = await Moq.Connection.connect(new URL("http://localhost:4443/"));

// Optional: Discover broadcasts matching a prefix.
const announced = conn.announced("demo/");
for (;;) {
	const announce = await announced.next();
	if (!announce) break;

	console.log("discovered broadcast:", announce.path);

	// NOTE: This code is untested and the API is subject to change.
	const broadcast = conn.consume(`demo/${announce.path}`);
	const track = broadcast.subscribe("catalog.json");

	// A track can have multiple groups (unordered+unreliable).
	const group = await track.nextGroup();

	// A group can have multiple frames (ordered+reliable).
	const frame = await group.nextFrame();

	// This is a Uint8Array; but the contents are actually JSON.
	console.log("received frame:", frame);

	// Don't forget to close to release resources.
	frame.close();
	group.close();
	track.close();
	broadcast.close();
}

License

Licensed under either:

0.3.9

11 months ago

0.3.15

10 months ago

0.3.14

11 months ago

0.3.13

11 months ago

0.3.12

11 months ago

0.3.0

1 year ago

0.4.5

9 months ago

0.3.6

12 months ago

0.4.4

10 months ago

0.3.5

1 year ago

0.3.8

12 months ago

0.4.6

9 months ago

0.3.7

12 months ago

0.5.0

7 months ago

0.4.1

10 months ago

0.3.2

1 year ago

0.4.0

10 months ago

0.3.1

1 year ago

0.4.3

10 months ago

0.3.4

1 year ago

0.6.0

6 months ago

0.4.2

10 months ago

0.3.3

1 year ago

0.2.0

1 year ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago