From 64822b644f89654ffbe1c60a20374a34f4d3e0ef Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 30 Jul 2019 16:59:46 -0700 Subject: [PATCH] WebTorrent: Support rendering images, PDFs, more media formats, and text-like files Fixes: https://github.com/brave/brave-browser/issues/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