Installation
Package Information
- Version: 0.2.2
- License: MIT OR Apache-2.0
- Repository: github:moq-dev/moq
- Dependencies:
@moq/hang,@moq/lite,@moq/signals,@moq/ui-core
Web Component Usage
The easiest way to publish MoQ streams is using the<moq-publish> web component.
Web Component API
Attributes
| Attribute | Type | Description |
|---|---|---|
url | string | WebTransport URL of the MoQ relay |
fingerprint | string | URL to relay’s certificate fingerprint |
broadcast | string | Name of the broadcast to publish |
token | string | JWT authentication token (required for publishing) |
source | ”camera” | “screen” | Media source (default: “camera”) |
video | boolean | Enable video (default: true) |
audio | boolean | Enable audio (default: true) |
preview | boolean | Show local preview (default: true) |
Properties
Methods
Events
JavaScript API
For more control, use the JavaScript API directly:Broadcast API
Video API
Audio API
Source API
Capture media from different sources:Chat API
Complete Example
Here’s a complete HTML page:TypeScript Example
Authentication
Publishing requires a JWT token with publisher role:UI Customization
The publish component includes a Solid.js UI that can be customized:Browser Support
Requires:- WebTransport API (Chrome 97+, Edge 97+, Opera 83+)
- WebCodecs API (Chrome 94+, Edge 94+, Opera 80+)
- MediaDevices API (all modern browsers)
Next Steps
@moq/watch
Watch the streams you publish
@moq/token
Generate authentication tokens
@moq/hang
Learn about the media layer
@moq/ui-core
Customize the UI theme