[Feature] Replace svg emoji with png counterpart:
Candygoblen123 opened this issue · comments
Checklist
- This is an issue for Hyperchat, not LiveTL. I will go to the LiveTL repo to report an issue for LiveTL.
- I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
- I am not reporting a bug. If I am, I will use the bug report issue template.
- By submitting this issue, you agree to follow our Code of Conduct
Is your feature request related to a problem? Please describe.
A performance issue with rendering a massive amount of svg files
Describe the solution you'd like
Using the emoji I’d, we can replace the YouTube svg emoji with either a png counterpart or with the system emoji counterpart
Expected behavior
YouTube emojis, which often get spammed, should be replaced with a png counterpart, or even better, a system emoji.
Describe alternatives you've considered
No response
Anything else?
No response
Here’s what we use in iOS to convert the svg to emoji: https://github.com/LiveTL/ios/blob/f57350745dd7c82aef04e520c3d581022b8cb42f/ios/Views/StreamView/ChatCell/ChatCell.swift#L56
Do note that if you mess up the png path, it will go and return (and in some cases, attempt to render) the entire YouTube 404 page
regex to find the url with default svg emoji within the messages
src="https:\/\/www\.youtube\.com\/s\/gaming\/emoji\/[a-zA-Z\d]+\/[a-zA-Z]+_[a-zA-Z\d]+\.svg
Seems like only "standard" emojis are being served with SVGs for now. I'd rather switch them to their unicode counterparts (which is fortunately provided in the json as alt text) than changing the URLs in case YT stops providing the pngs or something.
Adding an option would also fix #46