Google Docs 和 Microsoft Office Live 无法从 Firebase 存储中嵌入/渲染 doc/pdf/ppt 文件。我什至将我的 Firebase 存储规则设置为可公开访问。我还尝试使用 javascript | 嵌入 url encodeURIComponent| encodeUri仍然不能解决我的问题。
//This is the public url of .ppt that I want to display in my html website:
https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe
我尝试了几种方法,如下所示:
<!-- This one from google docs doesnt work -->
<iframe src="//docs.google.com/gview?alt=media&embedded=true&url=https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe" style="width:600px; height:500px;" frameborder="0"></iframe>
<!-- This one from microsoft doesnt work either -->
<iframe src="https://view.officeapps.live.com/op/embed.aspx?src=https://firebasestorage.googleapis.com/v0/b/work-from-home-app.appspot.com/o/tasks%2Fwqk5vnsYlySImAbukg5Z%2Ftest.pptx?alt=media&token=0eabee36-844f-47de-b643-6fa7d8841dfe" style="width:600px; height:500px;" frameborder="0"></iframe>
可悲的是,以上都不起作用。但是当我尝试从某人的网站嵌入 .ppt 时,它工作正常。
<!-- This one works! -->
<iframe src="//docs.google.com/gview?alt=media&embedded=true&url=http://video.ch9.ms/build/2011/slides/TOOL-532T_Sutter.pptx" style="width:600px; height:500px;" frameborder="0"></iframe>
我猜我的 Firebase 存储有问题?或者根本不可能从firebase渲染/显示文档文件到google docs或microsoft api?