mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
view: 1240|reply: 3
打印 prevThread nextThread

谷歌http调用视频问题,代码如下,调用成功,但视频卡顿掉帧严重

[copyURL]

5

主题

11

帖子

59

积分

member

Rank: 2

积分
59
jumpTo
owner
poston 2019-10-17 15:36 | authorOnly 回帖奖励 |倒序浏览 |阅读模式
<div id='id_video' style="border: 1px solid black;width:100%;height:100%;"></div>
         <script type="text/javascript">
            var hndSession = null;
            window.onload = function () {
                jSW.swInit({
                    url: "http://117.186.28.121:8081", // bv_nginx.exe服务器地址
                    calltype: jSW.CallProtoType.HTTP, // AUTO: IE优先使用OCX, 如果希望IE仍然使用HTTP通信, 请使用jSW.CallProtoType.HTTP
                });
            }
            window.onbeforeunload = function () {
                      var szPuid ="<%=PUID%>";
                  var chanel = hndSession.swGetPuChanel(szPuid, 0);
                      chanel.swClose();
                        return '';
            }

            $(function(){
                           setTimeout(function(){
                                   hndLogin();
                           },1000);
                    ;
            });
            //登录
                function hndLogin(){
                         if (hndSession) { delete hndSession; }
                 hndSession = new jSW.SWSession({
                     server: '117.186.28.121', // 如果是jSW.CallProtoType.OCX方式,这里需要填写具体的IP
                     port: 9701,
                     onopen: function (sess) {
                         sess.swLogin({
                             user: 'admin',
                             password: '123456'
                         });
                     }
                 });

               // 注册事件的回调函数
               hndSession.swAddCallBack('login', sessionCallback);
           }
            
           function sessionCallback(sender, event, json) {
                        if (json.code == jSW.RcCode.RC_CODE_S_OK) {
                                   setTimeout(function(){
                                           playVideo();
                                   },2000);
                        }
                }
               
               

                /*
                * msgType: 消息类型
                *
                */
                function mpOnMessage(msgType, data){
                        if(data){
                                windowIndex=data.playid;
                        }
                }

        function playVideo(){
                var szPuid ="<%=PUID%>";
        var channelindex = 0;
        var chanel = hndSession.swGetPuChanel(szPuid, channelindex);
        var mediaDir = jSW.MEDIADIR.VIDEORECV;
            mediaDir = mediaDir | jSW.MEDIADIR.AUDIORECV
        var result = chanel.swOpenEx({
            bwindowless:false,
            bstretch:true,
            callback: function (options, response) {
                if (response.emms.code == jSW.RcCode.RC_CODE_S_OK) {
                    console.log("ok");
                }
            },
            div: 'id_video',
            media: mediaDir
        });
                               
        };
     </script>

reply

使用道具 report

6

主题

407

帖子

1614

积分

vipMem

Rank: 6Rank: 6

积分
1614
sofa
poston 2019-10-17 16:28 | authorOnly
您好,接口调用是正常的。卡顿是库的问题,我们正在排查定位问题。
reply agree Against

使用道具 report

0

主题

1

帖子

18

积分

newBie

Rank: 1

积分
18
bench
poston 2021-12-22 17:40 | authorOnly
有查出来啥问题嘛?我的也是,特别卡,几乎画面是5秒一动
reply agree Against

使用道具 report

11

主题

200

帖子

925

积分

advMem

Rank: 4

积分
925
ground
poston 2021-12-22 17:55 | authorOnly
请更新到最新的服务器测试   下载地址https://www.besovideo.com/detail?t=1&i=85或者可以先用我们的测试服务器测试下  地址http://61.191.27.18:8081/Demo/video.html
reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-5-3 18:12 , Processed in 0.056643 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList