langhuihui / jessibuca

Jessibuca是一款开源的纯H5直播流播放器
https://jessibuca.com
GNU General Public License v3.0
2.14k stars 401 forks source link

一次性加载四个视频cpu暂满 ,就想着用最新版本 、用了最新的版本插件, 视频一直loading在加载,也没报错~ 用之前的版本就可以直接加载 #210

Closed xia0j closed 2 years ago

xia0j commented 2 years ago

this.jessibuca = new window.Jessibuca(Object.assign( { container: this.$refs.container, videoBuffer: 0.2, // 最大缓冲时长,单位秒 isResize: true, isFlv: true, decoder: '/decoder.js', // text: "WVP-PRO", // background: "bg.jpg", loadingText: '加载中...', // hasAudio: typeof (this.hasAudio) == 'undefined' ? true : this.hasAudio, debug: false, supportDblclickFullscreen: false, // 是否支持屏幕的双击事件,触发全屏,取消全屏事件。 // showBandwidth: this.kBps, // 显示网速 operateBtns: { fullscreen: false, screenshot: false, // play: true, audio: false }, hotKey : false , hasAudio : false , useWCS: true , record: 'record', vod: this.vod, forceNoOffscreen: true, isNotMute: false },

play: function(url , i) { this.currentNum = i if (this.jessibuca) { this.destroy() } this.jessibuca.on('play', () => { this.playing = true this.loaded = true this.quieting = this.jessibuca.quieting })

    if (this.jessibuca.hasLoaded()) {
      this.jessibuca.play(url)
    } else {

      this.jessibuca.on('load', () => {
        this.jessibuca.play(url)
        this.jessibuca.setScaleMode(0)
      })
    }
  },
xia0j commented 2 years ago

this.jessibuca = new window.Jessibuca(Object.assign( { container: this.$refs.container, videoBuffer: 0.2, // 最大缓冲时长,单位秒 isResize: true, isFlv: true, decoder: '/decoder.js', // text: "WVP-PRO", // background: "bg.jpg", loadingText: '加载中...', // hasAudio: typeof (this.hasAudio) == 'undefined' ? true : this.hasAudio, debug: false, supportDblclickFullscreen: false, // 是否支持屏幕的双击事件,触发全屏,取消全屏事件。 // showBandwidth: this.kBps, // 显示网速 operateBtns: { fullscreen: false, screenshot: false, // play: true, audio: false }, hotKey : false , hasAudio : false , useWCS: true , record: 'record', vod: this.vod, forceNoOffscreen: true, isNotMute: false },

play: function(url , i) { this.currentNum = i if (this.jessibuca) { this.destroy() } this.jessibuca.on('play', () => { this.playing = true this.loaded = true this.quieting = this.jessibuca.quieting })

    if (this.jessibuca.hasLoaded()) {
      this.jessibuca.play(url)
    } else {

      this.jessibuca.on('load', () => {
        this.jessibuca.play(url)
        this.jessibuca.setScaleMode(0)
      })
    }
  },
bosscheng commented 2 years ago

直接这样就行了 this.jessibuca.play(url) 试试看