mobile CCTV,mobile surveillance,police body worn cameras

标题: Failed to construct 'Worker': Script at 'https://61.191.27.18:9443/js/jswlib/... [打印本页]

author: 王颖    time: 2020-6-16 16:51
标题: Failed to construct 'Worker': Script at 'https://61.191.27.18:9443/js/jswlib/...
错误:
libffmpeg_265.js:1293 Uncaught DOMException: Failed to construct 'Worker': Script at 'https://61.191.27.18:9443/js/jswlib/thlib/HttpFlv/codec/libffmpeg_265.worker.js' cannot be accessed from origin 'http://localhost:8762'.
    at Object.allocateUnusedWorker (https://61.191.27.18:9443/js/jsw ... mpeg_265.js:1293:36)
    at Object.initMainThreadBlock (https://61.191.27.18:9443/js/jsw ... mpeg_265.js:1115:21)
    at https://61.191.27.18:9443/js/jsw ... mpeg_265.js:5047:38
[attach]2573[/attach]
源代码如下:




  1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  2. <html>
  3. <head>
  4.     <title></title>
  5. </head>
  6. <body>


  7. <input type="button" value="用test账户登录" onclick="testLogin()" />
  8. </body>
  9. </html>


  10. <script type="text/javascript" src="https://61.191.27.18:9443/js/jsw.js"></script>
  11. <script type="text/javascript">
  12.   window.onload = function () {
  13.     jSW.swInit({
  14.       url: 'https://61.191.27.18:9443', // bv_nginx.exe服务器地址
  15.       calltype: jSW.CallProtoType.AUTO, // AUTO: IE优先使用OCX, 如果希望IE仍然使用HTTP通信, 请使用jSW.CallProtoType.HTTP
  16.     });
  17.   };
  18.   window.onbeforeunload = function () {
  19.     jSW.swDeInit();
  20.   };

  21.   var session = null;
  22.   /*手动登录*/
  23.   function testLogin() {
  24.     if (session) {
  25.       delete session;
  26.     }
  27.     session = new jSW.SWSession({
  28.       server: '61.191.27.18', // 如果是jSW.CallProtoType.OCX方式,这里需要填写具体的IP
  29.       port: 9701,
  30.       onopen: function (sess) {
  31.         sess.swLogin({
  32.           user: 'test',
  33.           password: '123'
  34.         });
  35.       }
  36.     });

  37.     // 注册事件的回调函数
  38.     session.swAddCallBack('login', function (sender, event, json) {
  39.       alert(JSON.stringify(json, null, 4));
  40.     });
  41.     session.swAddCallBack('logout', sessionCallback);
  42.     session.swAddCallBack('pulist', sessionCallback);
  43.   }



  44.   </script>
copycode



author: IBeli    time: 2020-6-16 17:15
你好,9443端口是https的,你的页面也要使用https来加载。
https://localhost:8762。
第一个问题,可以尝试下使用ip+端口的方式访问,不要用localhost。如果不行,要远程看下。




欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) Powered by Discuz! X3.2