• 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播放器感兴趣,欢迎测试。

  • 相关阅读:
    Android笔记之添加退出确认对话框
    Android笔记之menu与ActionBar使用
    Android学习笔记之File存储(sd卡)
    cron 在线 表达式
    springboot
    mybatis 查询标签
    div display 常用属性
    css height VS min-height
    struts标签 解析html标签
    CSS 后代选择器
  • 原文地址:https://www.cnblogs.com/TSINGSEE/p/15562569.html
Copyright © 2020-2023  润新知