funmaker / Hybooru

Hydrus-based booru-styled imageboard in React
https://booru.funmaker.moe/
MIT License
100 stars 17 forks source link

Add ogv.js player #37

Closed LoliOnTop closed 8 months ago

LoliOnTop commented 11 months ago

Hi! There's a dumb company out there that makes portable computers that can't play Theora/VP8/VP9/etc. It can not be enabled or installed, even if you paid the full cost of the computer! Of course, you should not buy a computer like that, that would be stupid but, unfortunately, I have a computer like that already! I promise I will not buy another computer with such a silly limitation, I made a mistake.

But we should try to save dumb computers from landfills. It is a shame for a computer to get thrown away for this. It is the company that is trash, not the computer!

Therefore, I have attempted to integrate the ogv.js player into Hybooru, to allow me to view very important videos even on my dumbest computers. I have tested and found even very large video can play quite well on the dumb computer using ogv.js. Who knew?

The PR adds:

I think we could add full player chrome but video.js seems bloated so I decided it would probably be better if we make it by hand. But, getting WebM video to play first seems better to start.

Maybe it would also be a good idea to add ability to set Ogv.js preference, "Always", "Auto-detect", "Never"?

Let me know what you think!

LoliOnTop commented 11 months ago

Not sure if you are either busy, or if you have no intent to merge a feature like this. If you do not want to have a feature like this, please feel free to close the issue, and I can just maintain a fork instead.

In the mean time, for the kind of peoples who download and execute unsigned binary packages from sketchy people with funny names, I have build with the ogv branch for my own personal usage.

https://github.com/LoliOnTop/Hybooru/pkgs/container/hybooru

I guess not many people are going to use fruit devices with Hybooru client, but ogv.js may be interesting again now that browsers are also removing Theora support.

https://winaero.com/chrome-and-firefox-may-soon-drop-theora-codec-support/

Modern Fruit devices can play VP8 WebMs at over 1080P 30FPS using ogv.js, so old Theora files should run very well on even modest computers using WebAssembly software decoding. Ugly as it may be...

Anyway, I hope this finds you well. I do not mean to bother.

funmaker commented 8 months ago

I am not sure about adding that just to fix some issue on Apple computers specifically. If this can be fixed with some JS, can't you just install some browser extension that will do it for you on all the websites? Or make a tampermonkey/greasemonkey script?

Either way, I rather not bloat the website with this. However if you can find a way to make it work with simple JS script that could be added to the website, I could add a config option to specify external scripts that would get added in HTML <head> section or something like that.

LoliOnTop commented 8 months ago

I understand. I will try to look into less obtrusive ways to do this thing. However, I would like to at least offer some thoughts on why I chose this approach:

Anyway, I am sorry that my solution does not meet your expectations. For now, I will just maintain my soft-fork until I can come up with a better approach. Thanks for the consideration.

edit: actually hmm I suppose I can just DOM-replace the <video> player wholesale rather than try to jam ogv functionality into it somehow... i guess maybe i have been overthinking it a bit...

funmaker commented 8 months ago

There probably is some solution to that, that would work for any website. Quick search gave me few suggestions, but I don't know how reliable they are. But as long as you can write a browser plugin yourself that can access DOM, all you need is just document.querySelectorAll to find all <video> and MutationObserver to detect any new videos added dynamically. Then, just do whatever Ogv.js setup requires and you should be good to go.