[英]How to exit full screen mode in Safari
無法在 safari 中退出全屏模式。
document.exitFullscreen()
不起作用
Safari 使用wekbit
前綴。 所以,而不是document.exitFullscreen()
它只是document.webkitExitFullscreen()
。
我處理這個的方法是檢查函數並使用.bind
:
const exitFunc = document.exitFullscreen || (document as any).webkitExitFullscreen;
const exitFullScreen = exitFunc.bind(document);
exitFullscreen();
根據以下文章,iOS 上的 Safari 不支持此方法
https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.