Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTorrent: Certain file types do not render correctly #5326

Closed
feross opened this issue Jul 22, 2019 · 5 comments · Fixed by brave/brave-core#3053
Closed

WebTorrent: Certain file types do not render correctly #5326

feross opened this issue Jul 22, 2019 · 5 comments · Fixed by brave/brave-core#3053

Comments

@feross
Copy link

feross commented Jul 22, 2019

Reposting an issue mentioned in a comment:

Certain file types which the browser does not know how to open just appear as gibberish in a text box, and there is no UI option to "save as". The "save" only works with media files that the browser knows should be rendered in the media player. For example try downloading a torrent with an m4b file in it in brave on macos. I get this:
image

Originally posted by @Matt812 in #1436 (comment)

@feross feross added feature/webtorrent Label for webtorrent related issues needs-investigation A bug not 100% confirmed/fixed labels Jul 22, 2019
@feross feross self-assigned this Jul 22, 2019
feross added a commit to feross/render-media that referenced this issue Jul 30, 2019
@feross feross added bug and removed needs-investigation A bug not 100% confirmed/fixed labels Jul 31, 2019
@feross
Copy link
Author

feross commented Jul 31, 2019

Test Plan

  1. Visit this URL: https://ia800301.us.archive.org/14/items/art_of_war_librivox/art_of_war_librivox_archive.torrent
  2. Start the torrent download
  3. Click on file 1 "ArtOfWar-64kb_librivox.m4b" and confirm that the audio file plays.
  4. Click on file 2 "Art_War_1107.jpg" and confirm that an image shows up.
  5. Click on file 3 "Art_War_1107.pdf" and confirm that the PDF viewer loads with a PDF inside.
  6. Click on file 11 "art_of_war_01-02_sun_tzu.ogg" and confirm that the audio file plays.
  7. Click on file 12 "art_of_war_01-02_sun_tzu.png" and confirm that the image shows up.

feross added a commit to brave/brave-core that referenced this issue Jul 31, 2019
…ext-like files

Fixes: brave/brave-browser#5326

Previously, images and PDFs would not render at all. Other formats would render in a very tiny iframe which was unusable. Unsupported formats would render as gibberish text.

Now, we properly support images, centered, with a black background behind them, just like for audio and video.

For PDFs, we use the native built-in PDF viewer and render at 100% width and height.

For text-like files, we render them in a full-screen iframe with the default white page background.

For audio, we now support FLAC, M4B, M4P, and OGA formats. The browser still has to support the specific codec used within the file, but we'll render an <audio> tag and at least attempt to play it.
@yrliou yrliou added this to the 0.70.x - Nightly milestone Jul 31, 2019
@kjozwiak
Copy link
Member

kjozwiak commented Sep 18, 2019

Verification PASSED on macOS 10.14.6 x64 using the following build:

Brave 0.69.126 Chromium: 77.0.3865.65 (Official Build) (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS macOS Version 10.14.6 (Build 18G95)

Verification passed on

Brave 0.69.127 Chromium: 77.0.3865.75 (Official Build) (64-bit)
Revision 201e747d032611c5f2785cae06e894cf85be7f8a-refs/branch-heads/3865@{#776}
OS Ubuntu 18.04 LTS

Verification passed on

Brave 0.70.97 Chromium: 77.0.3865.65 (Official Build) beta (64-bit)
Revision 87a331a3169cab563505fb44011058b904011ba1-refs/branch-heads/3865@{#726}
OS Windows 10 OS Version 1803 (Build 17134.1006)

@kjozwiak
Copy link
Member

@feross I noticed that the background usually goes completely black when opening files as per:

backgroundIssue

All the files are opening correctly, but after ~5s or so, the background goes black. Is this expected behaviour? Why not keep the background white? Let me know if this is an issue and I can create a new GH bug 👍

@feross
Copy link
Author

feross commented Sep 18, 2019

You can open a new GH bug for this. It shouldn't take this long to make the background black. The goal was to ensure that media files have a black background. But the main torrent interface has a white background, so this is handled in the Redux state. But it seems like this can take a really long time to run in your case. That's not good. Also, the black background makes this image completely unviewable. I'd like to check in Chromium and see if this image has the same viewability problem, since they also use a black background.

@kjozwiak
Copy link
Member

@feross thanks for the summary 👍 Created #6094.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment