@p1xel.tv/webrtc-player
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

WebRTCPlayer

WebRTC peer connection video Player written in typescript

This project is heavily inspired by the Unreal Engine 4 Pixelstreaming Example https://docs.unrealengine.com/en-US/SharingAndReleasing/PixelStreaming/index.html

install

yarn add @p1xel.tv/webrtcplayer or npm i @p1xel.tv/webrtcplayer

example

import {WebRTCPlayer} from "@p1xel.tv/webrtcplayer";

let rtcPlayer = new WebRTCPlayer(htmlElement, options, webSocket)
rtcPlayer.onWebRtcOffer = (offer: RTCSessionDescriptionInit) => {
    //send offer to Signalling/PeerConnection
};
rtcPlayer.onWebRtcCandidate = (candidate: RTCIceCandidate) => {
    //send candidate to Signalling/PeerConnection
};
rtcPlayer.onDataChannelConnected = () => {
    //...;
};
rtcPlayer.onDataChannelMessage = (data: ArrayBufferLike) => {
    //...
};
rtcPlayer.onVideoInitialised = () => {
    //...
};

Development

  • Use yarn because of the lock file

yarn

Creating a bundle

yarn wp

Publishing

yarn pub

Readme

Keywords

Package Sidebar

Install

npm i @p1xel.tv/webrtc-player

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

27.3 kB

Total Files

40

Last publish

Collaborators

  • n.zweifel