Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当存在多实例的时候,比如四分屏,九分屏播放多路视频时,多个屏同时调用各自实例的close(); clearView();关闭失效。画面仍然存在。 #62

Closed
yu1183688986 opened this issue Aug 27, 2021 · 3 comments

Comments

@yu1183688986
Copy link

yu1183688986 commented Aug 27, 2021

测试时,我才用四分屏,每个屏幕都绑定了一个
new window.Jessibuca(...)对象,配置都一样,同时播放四路视频,然后全部关闭视频
for (var i = 0; i < 4; i++) { var this_jessibuca = jessibucaObj[i]; /*console.log("player:",player);*/ if (this_jessibuca != null) { //this_jessibuca.pause(); this_jessibuca.close(); this_jessibuca.clearView(); } }
该功能会出现问题,存在部分屏幕还原到黑屏状态,部分仍然存在视频停止后的画面图片;
我目前的解决办法是加入了延迟,并多调用几次。
`for (var i = 0; i < 4; i++) {
var this_jessibuca = jessibucaObj[i];
/console.log("player:",player);/
if (this_jessibuca != null) {
//this_jessibuca.pause();
this_jessibuca.close();
this_jessibuca.clearView();
setTimeout((_obj,time)=>{
_obj.close();
setTimeout((obj)=>{
obj.clearView();
},time,_obj);
},1000 + 20*i,this_jessibuca,150 * i);

	}

}`
但任然无法解决这个问题,多尝试几次还会存在无法全部关闭的效果;

@bosscheng
Copy link
Collaborator

@yu1183688986 把离线渲染(forceNoOffscreen)关闭就可以了。

@yu1183688986
Copy link
Author

@yu1183688986 把离线渲染(forceNoOffscreen)关闭就可以了。

这个问题的配置中forceNoOffscreen这个参数我配置的是true了。

@bosscheng
Copy link
Collaborator

@yu1183688986 设置为false就行了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants