npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

promiseq-angular-webrtc-player

v1.0.1

Published

Angular WebRTC Player for promiseQ

Downloads

4

Readme

promiseQ Angular WebRTC Player

Angular WebRTC Player for promiseQ

Installation

npm install promiseq-angular-webrtc-player

Usage

1. Import the Module

import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { WebrtcPlayerModule } from "promiseq-angular-webrtc-player";

import { AppComponent } from "./app.component";

@NgModule({
    declarations: [AppComponent],
    imports: [BrowserModule, WebrtcPlayerModule],
    providers: [],
    bootstrap: [AppComponent],
})
export class AppModule {}

2. Use the Component

<webrtc-player [streamUrl]="'ws://localhost:8889/stream/live/whep'" [autoPlay]="true" [muted]="false" [authToken]="'your-auth-token'" [containerClass]="'custom-container'" [videoClass]="'custom-video'" [loaderClass]="'custom-loader'" [errorClass]="'custom-error'" (onReady)="onStreamReady($event)" (onError)="onStreamError($event)" (onTrack)="onStreamTrack($event)" (playStateChanged)="onPlayStateChanged($event)"> </webrtc-player>

3. Component Events

export class AppComponent {
    onStreamReady(data: any) {
        console.log("Stream is ready:", data);
    }

    onStreamError(error: string) {
        console.error("Stream error:", error);
    }

    onStreamTrack(track: any) {
        console.log("Track received:", track);
    }

    onPlayStateChanged(isPlaying: boolean) {
        console.log("Play state changed:", isPlaying);
    }
}

API Reference

Input Properties

| Property | Type | Default | Description | | ---------------- | --------- | ------- | ------------------------------------------ | | streamUrl | string | "" | WebRTC stream URL (WHEP endpoint) | | autoPlay | boolean | true | Auto-start the stream when component loads | | muted | boolean | false | Mute the video audio | | authToken | string | "" | Authentication token for the stream | | containerClass | string | "" | Custom CSS class for the container | | videoClass | string | "" | Custom CSS class for the video element | | loaderClass | string | "" | Custom CSS class for the loading overlay | | errorClass | string | "" | Custom CSS class for the error overlay |

Output Events

| Event | Type | Description | | ------------------ | ----------------------- | ----------------------------------- | | onReady | EventEmitter<any> | Fired when the stream is ready | | onError | EventEmitter<string> | Fired when an error occurs | | onTrack | EventEmitter<any> | Fired when a new track is received | | playStateChanged | EventEmitter<boolean> | Fired when play/pause state changes |

Public Methods

| Method | Description | | ------------------- | ----------------------------- | | startStream() | Start the WebRTC stream | | stopStream() | Stop the WebRTC stream | | play() | Play the video | | pause() | Pause the video | | togglePlayPause() | Toggle between play and pause |

Component State Properties

| Property | Type | Description | | -------------- | --------- | ---------------------------------------- | | isLoading | boolean | Whether the stream is loading | | isPlaying | boolean | Whether the video is playing | | isConnected | boolean | Whether WebRTC connection is established | | errorMessage | string | Current error message if any |

Styling

The component comes with default styling, but you can customize it using CSS classes:

/* Custom container styling */
.custom-container {
    border: 2px solid #007bff;
    border-radius: 8px;
}

/* Custom video styling */
.custom-video {
    filter: brightness(1.1);
}

/* Custom loader styling */
.custom-loader {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Custom error styling */
.custom-error {
    background-color: rgba(255, 0, 0, 0.1);
}

Requirements

  • Angular 17+
  • Modern browser with WebRTC support

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues, please file them on the GitHub Issues page.