if(flvjs.isSupported()){
// let videoBox = document.querySelector('#video');
let videoBox = this.$refs[this.boxname];
let flvPlayer = flvjs.createPlayer({
type:'flv',
url:flvSrc,
cors:true,
isLive: true,
},{
enableWorker: true,
enableStashBuffer: false,
stashInitialSize: 128,
});
flvPlayer.attachMediaElement(videoBox);
flvPlayer.load();
flvPlayer.play();
this.player = flvPlayer;
}
1.主要是后台提供flv格式的流
2.createPlayer 提供兩個參數 一個是播放源 配置 一個是對於播放延時回放等的設置
3.將內容置於video標簽並通過 attachMediaElement 函數綁定起
