An Encrypted Media Source Extensions (MSE) Video Player
Overview
-
This is a modified version of the Media Source Extensions (MSE) Video Player.
-
The basics are the same. It just uses encrypted files and passes the them through a copy of the WASM decryption module from Password Protecting Static Site Content with WASM.
-
Encryption is done on the Encrypting Static Site Content with WASM page.
-
The goal is to update the Multi-Player project so videos load as fast in Chrome as they do in Firefox and Safari.
-
It's important to note that the password is included in the HTML for this prototype. That approach can be used for obfuscation. It doesn't work for protecting content through since the key can be extracted from the source code.
The Video
Here's the video which is from pexels.
The JavaScript
This is the module that makes things work:
It's basically the same thing as A Media Source Extensions MSE Video Player with with the WASM decryption module from Password Protecting Static Site Content with WASM thrown in.
The HTML
The code for the page looks like this:
Exactly the same structure as A Media Source Extensions MSE Video Player. Only the URLs changed.
NOTE: Each part-##.part.bin file has to be encrypted
individually after the file spilt occurs.
(That is, you can't encrypt the church-3818213.webm
and split it. You have to split first then encrypt.)
Details on the video prep and file split are on A Media Source Extensions MSE Video Player.
Wrap Up
Server video used to feel like magic. Something that required more tech than I had access to. Of course, that wasn't true. We've got access to the same browser APIs as YouTube. What's cool here is that with the current APIs there's no need to have a dynamic server in order to deliver encrypted videos that are served piece by piece.
We live in the future.
-a
References
See these pages for more details and references: