Force HTML5 video to use NPAPI?

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1024
Joined: 2020-11-03, 06:47
Location: Philippines

Force HTML5 video to use NPAPI?

Post by jobbautista9 » 2025-10-14, 09:14

I noticed when I disable WebM support and then try to play a WebM video directly, the browser offers me an option to play it with the VLC Web Plugin. I wonder how feasible it would be to force all <video>s (as well as <audio>s) to be handled by NPAPI instead of the browser. Would such a behavior even be compliant with the HTML5 spec?
Image

"Destroying things, smartly!" - IJN Samidare, probably

Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5688
Joined: 2015-12-09, 15:45

Re: Force HTML5 video to use NPAPI?

Post by moonbat » 2025-10-14, 22:58

Can you post a sample link to try this? Also what version of VLC are you using? I have 3.0.20 on Linux and there's no NPAPI included.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
UCyborg
Astronaut
Astronaut
Posts: 539
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Force HTML5 video to use NPAPI?

Post by UCyborg » 2025-10-15, 00:12

ViewTube (you want the user script) can work with YouTube.

VLC 3.0.21 for Windows comes with NPAPI plugin. Judging by this commit, I have the impression it's bundled as a leftover. I've not seen it on Linux.

User avatar
jobbautista9
Board Warrior
Board Warrior
Posts: 1024
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Force HTML5 video to use NPAPI?

Post by jobbautista9 » 2025-10-15, 03:45

moonbat wrote:
2025-10-14, 22:58
Can you post a sample link to try this? Also what version of VLC are you using? I have 3.0.20 on Linux and there's no NPAPI included.
Sample VP9 WebM: https://base-n.de/webm/out9.webm

I have VLC 3.0.21 on Windows, which includes an NPAPI plugin versioned 3.0.3.0. I think for Linux you might have to recompile VLC with the NPAPI plugin enabled in the build config.
UCyborg wrote:
2025-10-15, 00:12
ViewTube (you want the user script) can work with YouTube.
Unfortunately it doesn't work with VORAPIS... Either VORAPIS will have to make their custom video player more compatible with YouTube's or ViewTube will have to target VORAPIS's player too.

Anyway I am aware of the ViewTube userscript (and I have used it before VORAPIS became a thing), but I would like something more universal... I'm thinking of writing a global userscript that converts all <video>s and <audio>s to <embed>s. It would still be nice if the browser itself offers the usage of NPAPI when it encounters an HTML5 video or audio in a webpage it can't play though.
Image

"Destroying things, smartly!" - IJN Samidare, probably

Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
UCyborg
Astronaut
Astronaut
Posts: 539
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Force HTML5 video to use NPAPI?

Post by UCyborg » 2025-10-16, 17:41

I see, everything being wrapped in layers of JavaScript makes things difficult. I haven't experimented with this for a while. When I did try it, I didn't like that it didn't blend in as smoothly as expected. VLC may also not be the most optimal video player in general.