[Demos] YouTube
See original GitHub issueDescription:
There’s a neat YouTube demo implemented using React which allows you to see the homepage of videos, the watch page and search page.
I would like for us to make it a little smarter by:
📹 [P0] Video watch page: instead of loading the full embed-video component, we: check if you are on a slow network OR a low-memory device OR have low hardware concurrency and serve down a lighter custom element for the player instead (we may need to wrap it a little for use in React). We can use a similar pattern to network aware code-splitting, but add checks for memory and concurrency in the same boolean check within React.lazy()
.
🔗 [P0] Routing: Fix routing so that the links to https://marvtron.github.io/watch?v=GKXS_YA9s7E (etc) take you to https://marvtron.github.io/youtube-react/watch?v=GKXS_YA9s7E. Accessing https://marvtron.github.io/youtube-react/watch?v=GKXS_YA9s7E directly should load the video watch page.
🙊 [P1] On slow network or low-memory or low hardware-concurrency, don’t load the comments widget and limit (by half) the number of results returned for the recommended videos:
🔧 [P0] I would like us to add the following code to the index so we can quickly show on the watch page which components are important vs not.
<script>
window.debug = () => {
document.querySelector('.video-container').style.border = '15px solid green';
document.querySelector('.related-videos').style.border = '15px solid red';
document.querySelector("#root > div > div.watch-grid > div:nth-child(5)").style.border = '15px solid red';
};
</script>
🎨[P2] Take a quick look at whether render-blocking CSS can be optimized (e.g do we need all of semantic-ui?). I was reading through https://marvtron.github.io/youtube-react/static/css/2.20edb33d.chunk.css and at the very least, I think we don’t need to load in the import for the Lato font. YouTube just uses Roboto if installed and I’m cool with us falling back to Arial without loading a Web Font (font-family: roboto, arial, sans-serif;
)
I would say this is probably higher priority than #https://github.com/GoogleChromeLabs/adaptive-loading/issues/63 for this week but could be looked at after #86 (#86, #87, #83, then #63).
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (11 by maintainers)
Top GitHub Comments
Ah, I see. This makes sense. Given we won’t be clicking on links in the sidebar I think this is OK.
On Tue, Nov 5, 2019, 6:17 PM anton-karlovskiy notifications@github.com wrote:
That matches my thinking too. Let’s move ahead using Hooks here… 😃