简体   繁体   English

如何使用jQuery删除“停止共享”弹出窗口

[英]How to remove “stop sharing” popup using jQuery

I am using screen share extension to share screen on chrome with other users and when I share my screen with other users a popup open up with "stop sharing" button and never close even when screen share is closed. 我正在使用屏幕共享扩展名与其他用户共享chrome上的屏幕,当我与其他用户共享屏幕时,会弹出一个弹出窗口,显示“停止共享”按钮,即使关闭了屏幕共享也永远不会关闭。

I know that it should close automatically but now I need it to close programatically so is there any way to close this popup programatically. 我知道它应该自动关闭,但是现在我需要以编程方式关闭它,因此有什么方法可以以编程方式关闭此弹出窗口。

I am referring below popup. 我指的是以下弹出窗口。

我指的是这个弹出窗口

I have also tried below code to remove this popup: 我还尝试了以下代码来删除此弹出窗口:

window.stream.getTracks().forEach(function(e) { window.stream.getTracks()。forEach(function(e){

        e.stop()

}); });

No there is no way to remove it using jQuery. 没有,没有办法使用jQuery将其删除。 It's not an element on the webpage, this is a Chrome native popup. 它不是网页上的元素,这是Chrome的本机弹出窗口。

The only way to remove it is to actually stop sharing. 删除它的唯一方法是实际上停止共享。 Make sure you are calling 确保您在打电话

session.unpublish(publisher); publisher.destroy();

如果您具有该元素的ID,则只需调用

$("#elementID").remove()

You can use 您可以使用

$('#your-id').hide();

or 要么

$("#your-id").remove();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM