@@ -213,16 +275,18 @@ function doPlayer(nodeData: any, index: number) {
};
addStreamProxy(params).then((res)=>{
consturl=res.wsFlv;
// 将url 绑定到 nodeData
nodeData.url=url;
closePlayer(index);
constvideoConfig={
type:'flv',
url:url,
isLive:true,
hasAudio:true,
hasAudio:false,
hasVideo:true,
enableWorker:true,// 启用分离的线程进行转码
enableStashBuffer:false,// 关闭IO隐藏缓冲区
stashInitialSize:128,// 减少首帧显示等待时长
stashInitialSize:256,// 减少首帧显示等待时长
};
constplayerConfig={
enableErrorRecover:true,// 启用错误恢复
@@ -248,6 +312,18 @@ function doPlayer(nodeData: any, index: number) {
}
}
functionclosePlayVieo(plInfo:any){
if(plInfo){
try{
plInfo.pause();// 暂停
plInfo.unload();// 卸载
plInfo.destroy();// 销毁
}catch(e){
console.log('播放器关闭失败,e=',e);
}
}
}
functionclosePlayer(index:number){
// 如果播放器存在,尝试关闭
constpData=playerList[index];
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.