@p1xel.tv/webrtc-player
v1.0.0
Published
WebRTC peer connection video Player written in typescript
Downloads
52
Readme
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