mobile CCTV,mobile surveillance,police body worn cameras

标题: vue使用@besovideo/webrtc-player报错 [打印本页]

author: cyy    time: 2024-5-9 10:52
标题: vue使用@besovideo/webrtc-player报错
运管中心的软件都已升级到最新版本
在vue2和vue3项目中,使用@besovideo/webrtc-player库最新版和历史版本都会报以下错误:
[attach]3395[/attach]

代码如下:
尝试了proxy代理api 和 直接连接后端接口,详见下方代码
  1. init() {
  2.       const { instance } = PuPlayer({
  3.         container: this.$refs.playerContainer,
  4.         puOption: {
  5.           // 设备id
  6.           id: 'PU_335xxx',
  7.           // 设备通道号
  8.           index: 0,
  9.         },
  10.         type: 'webrtc',
  11.         // 必填 用户授权令牌
  12.         // token: this.token,
  13.         videoFit: 'contain',
copycode
                 // 代理        apiPrefix:'/api',
        // 直接连接
        apiPrefix:'https://后端地址',
        // (可选) 双击是否全屏
        fullScreenOnDblclick: true,
        // (可选) 启用控制器
        enableController: true,
        // (可选) peer connection 连接媒体配置
        defaultMediaOption: {
          // 启用音频
          // audio: true,
          // 启用视频
          video: true,
        },
      onConnected: () => {

           this.messages.push("onConnected 连接已建立");
        },
        onConnectedFailed: () => {
          this.messages.push("onConnectedFailed 连接建立失败");
        },
        onClose: () => {
          this.messages.push("onClose 连接已关闭(播放器关闭)");
        },
        onDisConnected: () => {
          this.messages.push("onDisConnected  连接已关闭(服务器断开连接)");
        },
        onDestroy: () => {
          this.messages.push("onDestroy 播放器实例已销毁");
        },
      });
      this.instance = instance;
      setTimeout(function(){
        instance.open()
      },100)



author: besovideo    time: 2024-5-9 11:03
看看这个,平台对接时调用smarteye WEB SDK开发时遇到的常见问题FAQ full, https://www.besovideo.com/detail?t=1&i=326

author: IBeli    time: 2024-5-9 11:04
你好,感觉像是websocket连接失败了
看看网络面板中,websocket连接的远程服务地址多少
author: cyy    time: 2024-5-9 14:46
besovideo post on2024-5-9 11:03
看看这个,平台对接时调用smarteye WEB SDK开发时遇到的常见问题FAQ full, https://www.besovideo.com/deta ...

把之前项目下载的npm依赖包@besovideo/webrtc-player 0.8.51 拷贝到新项目,就好了~  就很神奇 其它什么也没有动

之前尝试下载相同版本、或高低版本都不行




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