live-qjc
v0.8.4
Published
ray-streaming launcher for qingjiao
Downloads
35
Readme
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>