zoukankan      html  css  js  c++  java
  • EasyPlayer播放FLV的H.265编码视频时出现两个FLV请求,如何调整?

    EasyPlayer播放器是TSINGSEE青犀视频维护的一个RTSP播放器项目,EasyPlayer遵循了标准流媒体码流协议,进行实时播放以及码流录制,在数据流的播放速度以及画质的解码显示上均做了大量深度的优化。

    在网页通过EasyPlayer播放flv的H.265时出现了两个flv请求:

    第一次创建播放器过程中对码流进行播放和解析。如果H.264则继续正常播放,当码流为H.265则需要销毁播放器,重新创建支持能播放H.265的播放器。参考代码如下:

    onCallback(code, type) {
      if (code === 12 && this.isWasm == false) {
        this.isWasm = true
          if (this.isWasm && this.wasmPlay == null) {
            this.$el.querySelector(".video-inner").innerHTML =       this.videoHtml;
            var element = this.$el.querySelector(".video-wasm");
            this.wasmPlay = new WasmPlayer(this.src, element, this.onWasmCallback, {
              Height: this.aspect == "100%",
              UnLogo: this.showLogo,
              openAudio: !this.muted,
            })
            this.wasmPlay.play(this.src, this.autoplay ? 1 : 0)      }
        })
      }
    },
    

    由于在@easydarwin/easyplayer 3.3.12并没销毁之前的播放才导致一直加载两路flv流。对此问题,在之后的版本我们已经优化了这个bug,EasyPlayer播放器已开源,如果大家对EasyPlayer播放器感兴趣,欢迎测试。

  • 相关阅读:
    leetcode 78. 子集 JAVA
    leetcode 91. 解码方法 JAVA
    leetcode 75. 颜色分类 JAVA
    leetcode 74 搜索二维矩阵 java
    leetcode 84. 柱状图中最大的矩形 JAVA
    last occurance
    first occurance
    classical binary search
    LC.234.Palindrome Linked List
    LC.142. Linked List Cycle II
  • 原文地址:https://www.cnblogs.com/TSINGSEE/p/15562569.html
Copyright © 2011-2022 走看看