gpt4 book ai didi

javascript - 阻止 google chrome 下载视频 - Android Chrome 浏览器

转载 作者:行者123 更新时间:2023-11-28 04:35:59 24 4
gpt4 key购买 nike

我有一个应用程序,我正在其上使用 jwplayer。在Android chrome浏览器上,当任何人长按视频时,都会有一个下载视频的选项。这是屏幕截图:

enter image description here

我可以通过 jquery 或其他方式禁用此选项吗?我已经尝试使用以下功能禁用长按,但它仍然无法禁用。

  function absorbEvent_(event) {
var e = event || window.event;
e.preventDefault && e.preventDefault();
e.stopPropagation && e.stopPropagation();
e.cancelBubble = true;
e.returnValue = false;
return false;
}

function preventLongPressMenu(node) {
node.ontouchstart = absorbEvent_;
node.ontouchmove = absorbEvent_;
node.ontouchend = absorbEvent_;
node.ontouchcancel = absorbEvent_;
}

有什么办法可以禁用它吗?

最佳答案

我已禁用上下文菜单。因此,该菜单选项不会显示。这是我禁用的js代码。希望这对其他人有帮助。

window.oncontextmenu = function(event) {
event.preventDefault();
event.stopPropagation();
return false;
};

关于javascript - 阻止 google chrome 下载视频 - Android Chrome 浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44206174/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com