Socket
Book a DemoInstallSign in
Socket

@p1xel.tv/webrtc-player

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@p1xel.tv/webrtc-player

WebRTC peer connection video Player written in typescript

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

Keywords

webRTC

FAQs

Package last updated on 25 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts