live-qjc
TypeScript icon, indicating that this package has built-in type declarations

0.8.4 • Public • Published

QingjiaoCloud RayStreaming Launcher

RayStreaming launcher

Quick start

import { Launcher } from 'live-qjc'

// NOTE: token, signaling address and iceServers were provided by qjcloud
const signaling = 'wss://xxx.xxx.xxx.xxx:xxxx'
const token = 'xxxxxxxxxxxxxxxxxxxxxxxx'
const iceConfig = [
  {
    urls: 'turn:xxx.xxx.xxx.xxx',
    username: 'xxxxxx',
    credential: 'xxxxxx',
  },
  {
    urls: 'stun:xxx.xxx.xxx.xxx',
    username: 'xxxxxx',
    credential: 'xxxxx',
  },
]

const container = document.createElement('div')
container.style.width = 'auto'
container.style.height = '100%'
document.body.appendChild(container)

const launcher = new Launcher(`${signaling}/clientWebsocket/${token}`, iceConfig, container)

ShowLoadingContent

launcher.showLoadingContent(text, loadingBgImage)
  • text <string>
  • loadingBgImage <string>

HideLoadingContent

launcher.hideLoadingContent()

GetLastFrame

launcher.getLastFrame(accuracy, alpha)
  • accuracy <number>
  • alpha <number>

Rivatuner

// NOTE: return an object
const report = launcher.getRivatunerInfo()
console.log(`
  FPS: ${fps}
  biterate: ${bitrate}kbps
  latency: ${latency}ms
  averageJitterBufferDelay: ${averageJitterBufferDelay}ms
  packetLossRate: ${(packetLossRate * 100).toFixed(3)}%
`)

Disconnetion

launcher.disConnection()

Screenful

launcher.setFullScreen()
launcher.exitFullScreen()

VideoSetting

change framerate
launcher.changeFrameRate(framerate)
  • framerate <number> fps
change bitrate
launcher.changeBitrate(bitrate)
  • bitrate <number> kbps
change resolution
launcher.changeResolution(width, height)
  • width <number>
  • height <number>

File Transfer

upload
launcher.uploadSingleFile(file)
download
launcher.sendFileResponse()
change download authority
launcher.setFileAuthority(permission)
  • permission <boolean>

Support Clipboard

Readme

Keywords

Package Sidebar

Install

npm i live-qjc

Weekly Downloads

2

Version

0.8.4

License

MIT

Unpacked Size

49.6 kB

Total Files

10

Last publish

Collaborators

  • huyurun
  • kitsch
  • ashen114
  • nnmax