Open JasonYao opened 1 year ago
looks like 100ms it won't update, 150 seems to work, and 125 might work with a few frame drops. At:
Let's say we go with 30s of bad apple to start.
150ms interval time: 1000ms / 150ms = 6.6666 frames per second 30s of content 6.6666 frames per second = 200 frames 200 frames 32 bytes per frame = 6400 bytes
125ms interval time: 1000ms / 125ms = 8 frames per second 30s of content 8 frames per second = 240 frames 240 frames 32 bytes per frame = 7,680 bytes
https://stackoverflow.com/a/5568484 might have a mechanism for us to have a data link instead of a naive href, enabling us to keep this all in memory.
With that, we've shown that with the bare minimum capabilities, this project is feasible.
split this into 2:
article: "playing bad apple in favicon"
build log: talk through stages:
brew install youtube-dl && youtube-dl FtutLA63Cp8
.mp4
file into individual frames that are in pythonbrew install ffmpeg
under the hood worked from https://stackoverflow.com/questions/15662827/writing-an-mp4-file-on-the-mac-with-opencv-ffmpegalternatives to mention:
This is a godawful, terrible, and useless to society idea.
So naturally I wanna see if it'd be possible. General user flow would be:
up, up, down, down, left, right, left, right, B, A and RETURN
could do the trick1s / 24 frames = 0.041s per frame
(might wanna time how long the favicon update takes). Alternatively, we could just swap the image the favicon is pointing to every 0.041s, and keep the favicon link stable (not sure if favicon is just cached though)Open questions to address at the start here
Step 1 can be done with an event listener, step 2 just with an API call to download bad apple which can be done pretty easily. Step 3 is an unkown, and there's a question of timing in step4 where we want to know how long the favicon update took.