|
Start Jsw Init
dependency_mgr.js:40 GET http://localhost:8762/youshi/js/jswlib/thlib/HttpFlv/codec/libffmpeg_265.js net::ERR_ABORTED 404 (Not Found)
jSWUtils.js:364 using broswer websocket
jSWProtocol.js:43 ws url: ws://61.191.27.18:9443/jswapi
jsw-session.js:176 websoket connect ...
jsw-session.js:81 WebSocket connection to 'ws://61.191.27.18:9443/jswapi' failed: Error during WebSocket handshake: Unexpected response code: 400
jsw-session.js:195 http websoket connect closed:1006 reason:
jsw-session.js:226 session did not login, should not reconnect
<script src="../Jquery/jquery-3.1.1.min.js"></script>
<script src="BootStrap4.0.0/bootstrap.min.js"></script>
<script src="../js/jsw.js"></script>
<link rel="stylesheet" type="text/css" href="logindemo.css"/>
<link rel="stylesheet" type="text/css" href="BootStrap4.0.0/bootstrap.min.css" />
window.onload = function () {
jSW.swInit({
url: 'https://61.191.27.18:9443', // bv_nginx.exe服务器地址
calltype: jSW.CallProtoType.AUTO, // AUTO: IE优先使用OCX, 如果希望IE仍然使用HTTP通信, 请使用jSW.CallProtoType.HTTP
});
};
window.onbeforeunload = function () {
jSW.swDeInit();
};
var session = null;
/*手动登录*/
function testLogin() {
if (session) {
delete session;
}
session = new jSW.SWSession({
server: '61.191.27.18', // 如果是jSW.CallProtoType.OCX方式,这里需要填写具体的IP
port: 9701,
onopen: function (sess) {
sess.swLogin({
user: 'test',
password: '123'
});
}
});
// 注册事件的回调函数
session.swAddCallBack('login', function (sender, event, json) {
alert(JSON.stringify(json, null, 4));
});
session.swAddCallBack('logout', sessionCallback);
session.swAddCallBack('pulist', sessionCallback);
|
|