mobile CCTV,mobile surveillance,police body worn cameras

 forgetPW
 registerNow
search
12NextPage
backToList newPost
view: 1152|reply: 13
打印 prevThread nextThread

web端开发问题,视频不呈现

[copyURL]

2

主题

8

帖子

22

积分

newBie

Rank: 1

积分
22
jumpTo
owner
poston 2023-4-4 20:16 | authorOnly 回帖奖励 |倒序浏览 |阅读模式
1.   samrteye服务器正常,端口已开,并且使用demo调用设备,能回显正常画面。遇到的问题时,我们把demo引入后,无法展示视频,并一直提示“视频关闭”
reply

使用道具 report

3

主题

343

帖子

1801

积分

vipMem

Rank: 6Rank: 6

积分
1801
sofa
poston 2023-4-4 20:18 | authorOnly
是server-E吧?是最新版本吧?请把公网IP、admin密码弄成默认的123456,我们也远程看看。此外,服务器软件的运管中心可以在线升级。

reply agree Against

使用道具 report

6

主题

408

帖子

1618

积分

vipMem

Rank: 6Rank: 6

积分
1618
bench
poston 2023-4-4 20:25 | authorOnly
你好,是webrtc还是bvrtc?   设备视频是h265还是h264的?控制台是否有报错?
reply agree Against

使用道具 report

0

主题

47

帖子

244

积分

midMem

Rank: 3Rank: 3

积分
244
ground
poston 2023-4-4 20:37 | authorOnly
首先保证网页版视频能正常打开,其次demo操作顺序也要按顺序来,或者刷新重新访问再操作一下,
如果改代码导致的问题就回滚到原始代码,检查代理是否正确,或者重新跑一下demo。
原demo是不可能有问题的,如果还有问题,就需要检查一下服务器和设备
reply agree Against

使用道具 report

2

主题

8

帖子

22

积分

newBie

Rank: 1

积分
22
5#
 Owner| poston 2023-4-4 20:39 | authorOnly
IBeli post on2023-4-4 20:25
你好,是webrtc还是bvrtc?   设备视频是h265还是h264的?控制台是否有报错?

webrtc 设备是h264 控制台会报这个
webrtc建立连接失败: OperationError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. a=rtpmap:8 G726/8000 Duplicate statically assigned payload type with conflicting codec name or clock rate.    at https://140.210.218.104:9781/cli ... f448f.js:439:112854    at Generator.throw (<anonymous>)    at i (https://140.210.218.104:9781/cli ... 73f448f.js:416:3844)
reply agree Against

使用道具 report

2

主题

8

帖子

22

积分

newBie

Rank: 1

积分
22
6#
 Owner| poston 2023-4-4 20:40 | authorOnly
coldflame post on2023-4-4 20:18
是server-E吧?是最新版本吧?请把公网IP、admin密码弄成默认的123456,我们也远程看看。此外,服务器软件 ...

是的 不出意外的话应该是新版的  公网ip:140.210.218.104  账号密码都是初始的
reply agree Against

使用道具 report

2

主题

8

帖子

22

积分

newBie

Rank: 1

积分
22
7#
 Owner| poston 2023-4-4 20:42 | authorOnly
张云威 post on2023-4-4 20:37
首先保证网页版视频能正常打开,其次demo操作顺序也要按顺序来,或者刷新重新访问再操作一下,
如果改代码 ...

网页版是可以正常打开的 demo也是可以正常打开的 只是将demo的代码粘贴到我们系统代码里 就不行了
reply agree Against

使用道具 report

3

主题

343

帖子

1801

积分

vipMem

Rank: 6Rank: 6

积分
1801
8#
poston 2023-4-4 20:44 | authorOnly
要不把你代码贴出来,我们配合一起看看。
reply agree Against

使用道具 report

0

主题

47

帖子

244

积分

midMem

Rank: 3Rank: 3

积分
244
9#
poston 2023-4-4 20:47 | authorOnly
测试接口了吗?是否有跨域拦截
reply agree Against

使用道具 report

2

主题

8

帖子

22

积分

newBie

Rank: 1

积分
22
10#
 Owner| poston 2023-4-4 20:51 | authorOnly
coldflame post on2023-4-4 20:44
要不把你代码贴出来,我们配合一起看看。

<template>

  <div v-loading="loading" style="width: 100%; height: 100%">

    <div

      ref="playerContainer"

      class="video"

      style="width: 100%; height: 100%"

    ></div>

  </div>

</template>

<script>

import { clearAllDialog } from "@besovideo/webrtc-player";

import { PuPlayer } from "@besovideo/webrtc-player";

// import { authLogin } from "@/api/camearScreen";

import "@besovideo/webrtc-player/dist/main.es.css";



export default {

  components: {},

  props: {

    puid: String,

  },

  data() {

    return {

      deveUi: "",

      loading: false,

      instance: null,

      username: "admin",

      password_encrypted:

        "SHA256:6848d6405bf34bf9b2d82ed8822c756807632d3eaefedec90ac33cb32ac83671",

      timestamp: "",

      result: "",

      token: "",

      index: 0,

      videoFit: "fill",

      Controls: [

        [

          "volume",

          "volumeSlider",

          "information",

          "screenshot",

          "record",

          "fullscreen",

          "rotate",

          "ptzControl",

        ],

      ],

    };

  },

  computed: {},

  watch: {},

  methods: {

    // 登录

    // async login() {

    //   this.deveUi = this.puid;

    //   console.log(8888888888888888, this.$route.query);

    //   if (this.$route.query.deveUi) {

    //     this.deveUi = this.$route.query.deveUi;

    //   }

    //   this.timestamp = Date.parse(new Date()) / 1000;

    //   const { username, password_encrypted } = this;

    //   if (!username || !password_encrypted) return;

    //   try {

    //     let params = {

    //       username,

    //       password_encrypted,

    //       timestamp: this.timestamp,

    //     };

    //     await authLogin(params).then((res) => {

    //       console.log(res);

    //       this.token = res.data?.token;

    //       this.init();

    //     });

    //   } catch (e) {

    //     console.error(111, e);

    //   }

    // },

    // 登录

    async login2() {

      this.timestamp = Date.parse(new Date()) / 1000;

      const { username, password_encrypted } = this;

      if (!username || !password_encrypted) return;

      try {

        const r = await fetch("/bvcsp/v1/auth/login", {

          method: "POST",

          headers: {

            "Content-Type": "application/json",

          },

          body: JSON.stringify({

            username,

            password_encrypted,

            timestamp: this.timestamp,

          }),

        });

        this.result = `${r.status} ${r.statusText}`;



        if (r.ok || (r.status >= 200 && r.status < 300)) {

          const res = await r.json();

          this.result += ` code: ${res.code}, msg: ${res.msg}`;

          // 设置token

          this.token = res.data?.token;

          this.isLogin = true;

          this.setCookie("Authorization", this.token, res.data?.timeout);



          return;

        }

        throw new Error(this.result);

      } catch (e) {

        console.error(e);

      }

    },

    // 初始化

    init() {

      this.loading = true;

      if (!this.token || !this.puid) return;

      const { instance } = PuPlayer({

        // (可选) 容器节点 注意一个容器内只能存在一个实例  当container为假值(包括false、null、undefined)时 将返回实例引用的dom节点 容器必须指定高度 参考高德地图

        container: this.$refs.playerContainer,

        // 必填 设备选项

        puOption: {

          // 设备id

          //   id: this.puid,

          id: "PU_24882025",

          //   id: "PU_21328198",

          // 设备通道号

          index: 0,

        },

        muted: true,

        // 必填 用户授权令牌

        token: this.token,

        videoFit: this.videoFit,

        // (可选) 双击是否全屏

        fullScreenOnDblclick: true,

        // (可选) 启用控制器

        enableController: true,

        disabledControls: ["ptzControl", "rotate", "information"],

        onConnected: () => {

          console.log("onConnected 连接已建立");

        },

        onConnectedFailed: () => {

          console.log("onConnectedFailed 连接建立失败");

        },

        onClose: () => {

          console.log("onClose 连接已关闭(播放器关闭)");

        },

        onDisConnected: () => {

          console.log("onDisConnected  连接已关闭(服务器断开连接)");

        },

        onDestroy: () => {

          console.log("onDestroy 播放器实例已销毁");

        },

      });



      this.instance = instance;

      this.open();

    },

    // 销毁

    destroy() {

      // destroy前会执行close

      this.instance?.destroy();

      this.instance = null;

      this.closed = true;

    },

    // 打开连接

    async open() {

      if (!this.instance) return;

      try {

        await this.instance.open();

        this.closed = false;

        this.loading = false;

      } catch (e) {

        console.log(e);

      }

    },

    // 关闭连接

    close() {

      this.instance?.close();

      this.closed = true;

    },

  },

  created() {},

  mounted() {

    // 释放全部本地播放器打开过的dialog

    clearAllDialog();

    this.login2();

  },

  beforeDestroy() {

    this.destroy();

  },

};

</script>

reply agree Against

使用道具 report

creditRule

QQ|wireless surveillance

GMT+8, 2024-6-2 20:40 , Processed in 0.061525 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

QuickReply backToTop BackToList