New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

live-cat-test

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

live-cat-test

ray-streaming launcher for 3dcat

  • 0.2.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

3DCAT RayStreaming Launcher

RayStreaming launcher

Quick start

import { Launcher } from 'live-cat'
const appKey = 'xxxxxxxxxxxxxxxxxxx'
const address = 'xxxxxxxxxxxxxxxxxxx'

const bootstrap = async () => {
  const player = document.querySelector('body')
  document.querySelector('body').style.width = '100vw'
  document.querySelector('body').style.height = '100vh'
  const launcher = new Launcher({
    address,
    appKey,
  })
  launcher.automata(player)
}
window.addEventListener('DOMContentLoaded', () => {
  if (
    navigator.userAgent.includes('miniProgram') ||
    navigator.userAgent.includes('MicroMessenger')
  ) {
    //NOTE: wechat environment started
    document.addEventListener('WeixinJSBridgeReady', bootstrap)
  } else {
    bootstrap()
  }
})

Play callback

// call when video element start to play
new Launcher({
  address,
  appKey,
  onPlay: () => {
    //do something
  },
})

Adjust bandwidth

launcher.changeBandwidth(
  8000, // start bitrate kbps
  10000, // max bitrate kbps
  5000, // min bitrate kbps
)
launcher.changeBandwidth(
  10000, // medians bitrate kbps
)

Statistics

launcher.toggleStatistics()
window.setInterval(() => {
  const { fps, bitrate, packetLossRate, latency, averageJitterBufferDelay } = launcher.report()
  console.log(`
    FPS: ${fps}
    biterate: ${bitrate}kbps
    latency: ${latency}ms
    averageJitterBufferDelay: ${averageJitterBufferDelay}ms
    packetLossRate: ${(packetLossRate * 100).toFixed(3)}%
  `)
}, 1000)

ToggleFullscreen

launcher.toggleFullscreen()

Destory

launcher.destory([errMsg])

Keywords

FAQs

Package last updated on 15 Apr 2022

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