Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wowza-webrtc-client

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wowza-webrtc-client

WoWza WebRTC Player/Client.

  • 0.0.25
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
74
increased by39.62%
Maintainers
1
Weekly downloads
 
Created
Source

Wowza Streaming Engine WebRTC Client

  • Written in TypeScript.

Install

npm i wowza-webrtc-client -s # yarn add wowza-webrtc-client

Usage

In Typescript

Configuration

import { WebRTCConfiguration } from 'wowza-webrtc-client'

const config: WebRTCConfiguration = {
  WEBRTC_SDP_URL: 'wss://mydomain.streamlock.net/webrtc-session.json',
  WEBRTC_APPLICATION_NAME: 'webrtc',
  WEBRTC_FRAME_RATE: 29,
  WEBRTC_AUDIO_BIT_RATE: 64,
  WEBRTC_VIDEO_BIT_RATE: 360,
}

// To print debug messages.
window.cnsl_debug = true

Using Player

const $video = document.querySelectorAll('video')[0]
const statusHandler = (isMuted, isPlaying, error) => {
  console.log('Status has invalidated', isMuted, isPlaying, error)
}
const playerInterface = WebRTCPlayer(config, $video, statusHandler)

# Use playerInterface to control your stream

const streamName = '12345-test-stream'
playerInterface.connect(streamName)

# later
playerInterface.stop()

Using Publisher

const $preview = document.querySelectorAll('video')[0]

const statusInvalidated = () => {
  console.log({
    isCameraReady: !this.handler.isCameraMuted,
    isHolding: this.handler.isHolding,
    isPublishing: this.handler.isPublishing,
    isPreviewEnabled: this.isPreviewEnabled,
    publisherError: this.handler.lastError
  })
}

const handler = new PublisherHandler(config, statusInvalidated)

const startPreview = () => {
  handler.attachUserMedia($preview)
}

const startPublishing = (streamName: string) => {
  handler.connect(streamName)
}

const stopPublishing = () => {
  handler.disconnect()
}

const stopPreview = () => {
  handler.stopPreview()
}

FAQs

Package last updated on 30 Dec 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc