You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

2 years ago
function importScripts(scriptUrl){
var script= document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", scriptUrl);
document.body.appendChild(script);
}
2 years ago
importScripts("./common.js")
importScripts("./parameter.js")
2 years ago
importScripts("./mqtt.js")
importScripts("./video.js")
importScripts("./audio.js")
importScripts("./webgl.js")
2 years ago
importScripts("./datachannel.js")
2 years ago
importScripts("./audiodc.js")
importScripts("./h265dc.js")
2 years ago
importScripts("https://cdn.bootcdn.net/ajax/libs/mqtt/2.18.8/mqtt.min.js")
importScripts("adapter-7.4.0.min.js")
importScripts("srs.sdk.p2p.js")
2 years ago
// importScripts("./adapter-latest.js")
2 years ago
function log(msg) {
console.log(msg);
// $("#loger").html(msg);
}
function endSession(){
endMqtt();
endWebrtc();
}
function stopSession() {
endMqtt();
endWebrtc();
}
function startDeviceSession(player){
bUseWebrtcP2P=true;
bDevicePull=false;
WEB_SEQID=uuid();
media_mode = "h265";
DEVICE_NAME=document.getElementById("deviceId").value;
subtopic = "kvmdev/" +DEVICE_NAME+ "/" + WEB_SEQID + "/#";//+"/"+deviceID //Control/00:13:14:01:D9:D5
pubtopic = "Control" + "/" + DEVICE_NAME;
initMqtt(player);
}