mobile CCTV,mobile surveillance,police body worn cameras

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

vue使用@besovideo/webrtc-player报错

[copyURL]

1

主题

2

帖子

7

积分

newBie

Rank: 1

积分
7
jumpTo
owner
poston 2024-5-9 10:52 | authorOnly 回帖奖励 |倒序浏览 |阅读模式
运管中心的软件都已升级到最新版本
在vue2和vue3项目中,使用@besovideo/webrtc-player库最新版和历史版本都会报以下错误:


代码如下:
尝试了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)


本帖子中包含更多资源

pls login 才可以下载或查看,没有帐号?registerNow

x
reply

使用道具 report

60

主题

1419

帖子

5843

积分

Moderator

Rank: 7Rank: 7Rank: 7

积分
5843
sofa
poston 2024-5-9 11:03 | authorOnly
看看这个,平台对接时调用smarteye WEB SDK开发时遇到的常见问题FAQ full, https://www.besovideo.com/detail?t=1&i=326
reply agree Against

使用道具 report

6

主题

408

帖子

1618

积分

vipMem

Rank: 6Rank: 6

积分
1618
bench
poston 2024-5-9 11:04 | authorOnly
你好,感觉像是websocket连接失败了
看看网络面板中,websocket连接的远程服务地址多少
reply agree Against

使用道具 report

1

主题

2

帖子

7

积分

newBie

Rank: 1

积分
7
ground
 Owner| poston 2024-5-9 14:46 | authorOnly
besovideo post on2024-5-9 11:03
看看这个,平台对接时调用smarteye WEB SDK开发时遇到的常见问题FAQ full, https://www.besovideo.com/deta ...

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

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

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-6-1 14:48 , Processed in 0.057613 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList