LarkSR WebClient SDK
Develop webclient for LarkSR cloudrending or LarkSR VR monitor client. Free design UI and define operate.
Links:
SDK include:
- LarkSR restful request.
- CloudRending Video.
- Handle input, keyboard, gamepad, touchscreen.
- Scale mode.
- Fullscreen mode.
- Landscap mode.
Notice
SDK V3.2.30 only support server version above V3.2.3.1 Old verion SDK Demo V3.2.314 server and datachannel above 3.2.5.1
Quick Start
install
- npm
npm i larksr_websdk
- plain html
<script src="larksr-web-sdk.min.js"></script>
Use
Import websdk with plain html SDK under global object larksr_websdk.
Connect cloud resource and all event access with new LarkSR object.
SDK default config html 100% height 100% width viewport. Auto handle input.
SDK mainly contain loading page and cloud video page no other ui.efore start:
- Lark SR server address, exp:http://222.128.6.137:8181/
- SDK auth code,connect business@pingxingyun.com or register https://www.pingxingyun.com/console/#/
- App id from Lark SR admin server applist.
var client = new LarkSR({
// root html element
// WARNING not document.documentElement
rootElement: document.getElementById('container'),
// Sever address
serverAddress: "Lark Sever address",
// SDK ID or set by call initSDKAuthCode
// authCode: 'your SDK ID',
// test backgroud url
// loadingBgUrl: 'https://home-obs.pingxingyun.com/homePage_4_0/bg.jpg',
});
Set sdk auth code.
client.initSDKAuthCode('Your SDK ID')
.then(() => {
// start connect;
client.connect({
// LarkSR cloud appid from LarkSR admin server.
// doc
// https://www.pingxingyun.com/online/api3_2.html?id=476
appliId: "appid from LarkSR admin"
})
.then(() => {
console.log('enter success');
})
.catch((e) => {
console.error(e);
});
})
.catch((e) => {
console.error(e);
});
// ...
// close connection.
// client.close();
// release DOM element.
// client.destroy();