Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

关于 h5 requestFullscreen API问题

使用h5 requestFullscreen API的时候 本地运行正常
但是放到服务器上的时候捕捉到报错

document.body.webkitRequestFullscreen().then(() => {
          console.log('成功切换全屏')
        }).catch(err=>{
          console.log('切换失败',err)
        })
报错
chunk-839a66ba.0e8b4483.js:1 切换失败 TypeError: fullscreen error
    at o (chunk-406711d2.f6406ade.js:1)
    at a.handleFullScreen (chunk-839a66ba.0e8b4483.js:1)
    at rt (chunk-vendors.66342a6f.js:22)
    at HTMLImageElement.n (chunk-vendors.66342a6f.js:22)
    at HTMLImageElement.Eo.o._wrapper (chunk-vendors.66342a6f.js:22)

但是也没有报具体是什么错误 请问大佬们如何定位?
现在怀疑服务器是 http 协议导致的?难道一定要用 https 吗?

问题已发现是 自己的项目 用 iframe 嵌套在了服务器上的项目导致报错,但是具体还是没有解决方案....


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...