Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

[Feature Request] Use PDF.js to render PDF previews for better device compatibility #63

Open
sengoku-f opened this issue Dec 2, 2020 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed todo Feature to be implemented

Comments

@sengoku-f
Copy link

在Mac的Chrome上视频播放有声音但是画面黑屏,ios端显示视频无法播放。
PDF在ios端无法显示。

@spencerwooo
Copy link
Owner

iOS 端无法显示 PDF 和视频属于正常现象吧?我记得 iOS Safari 并不支持……

@spencerwooo spencerwooo added bug Something isn't working question Common questions labels Dec 2, 2020
@sengoku-f
Copy link
Author

iOS 端无法显示 PDF 和视频属于正常现象吧?我记得 iOS Safari 并不支持……

研究了一下 iOS 端 PDF 感觉可以使用pdf.js来实现

@sengoku-f
Copy link
Author

sengoku-f commented Dec 6, 2020

试了下 PDF.js ,在 ios 端是可以预览 PDF 了
PDF.js 需要后端支持,可以托管在GitHub Pages,官方的pdf.js-gh-pages
然后使用https://sengoku-f.github.io/pdf.js/web/viewer.html?file={PDF链接}进行调用

测试链接
https://sengoku-f.github.io/pdf.js/web/viewer.html?file=https://sengoku-f.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf

解决 ${file['@microsoft.graph.downloadUrl']} 跨域问题

结合使用跨域资源共享(CORS)和 Cloudflare

更改文件名或 URL,以绕过缓存并指示 Cloudflare 检索最新的 CORS 标头

fallbackLink: '<iframe src="https://sengoku-f.github.io/pdf.js/web/viewer.html?file=${file['@microsoft.graph.downloadUrl']}?proxy" style="height: 80vh;width: 100%;border: 0;"></iframe>'

ipad 和 iPhone PDF.js 效果预览

@stale
Copy link

stale bot commented Dec 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 14, 2020
@spencerwooo spencerwooo added help wanted Extra attention is needed todo Feature to be implemented and removed wontfix This will not be worked on labels Dec 14, 2020
@spencerwooo
Copy link
Owner

我研究一下 PDF.js,视频黑屏在 Linux 的 Chrome 里面复现了,但我不知道怎么解决,我单独开一个 issue 来 track 视频黑屏问题。(我明明记得之前好好的……)

@spencerwooo spencerwooo changed the title 视频播放和PDF预览问题 [Feature Request] Use PDF.js to render PDF previews for better device compatibility Jan 2, 2021
@spencerwooo
Copy link
Owner

视频黑屏问题迁移到 #73

@spencerwooo spencerwooo removed the question Common questions label Jan 2, 2021
@leftchest
Copy link

安卓pdf也无法预览呢?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed todo Feature to be implemented
Projects
None yet
Development

No branches or pull requests

3 participants