Playing DVD in JavaScript for the sake of interoperability
For more details on this project, have a look at the video of the talk I gave at JS Conf 2014.
The slide deck is also available.
This branch, named converter
, contains an encoder of DVD to web format. For
the attempt to play DVD on-the-fly, look into the master
branch.
I ported libdvdread and libdvdnav to JavaScript. Several passes are applied to the content of a DVD to make it playable on a browser using native features:
Clone the repo locally and install the dependencies with:
$ npm install
$ bower install
$ grunt install
You'll need to install the latest version of ffmpeg.
Then, compile the TS files to JavaScript with:
$ grunt
If you see a message saying 'Done, without errors' then the compilation to JavaScript was successful.
Create the folder that will hold your DVD, e.g.:
$ cd /home/user/
$ mkdir dvd
$ pwd
/home/user/dvd
Then update the dvdPath
property of the config file in config/app.json
to
match the path to the folder created above.
Copy an unprotected DVD into a subfolder of dvd/
(e.g. in
/home/user/dvd/Sita Sings the Blues/
)
To convert the DVD, do:
$ node bin/convert /home/user/dvd/Sita Sings the Blues/
Wait for a while (reencoding video takes a loooooong time).
Start the web server:
node bin/http-server
Finally, point your browser to:
http://localhost:3000/
... and enjoy your DVD from your browser!
All browsers supporting the following features:
<video>
tag<track>
tag and WebVTT.Yes, please, use it, open issues and send pull requests.
There are several reasons:
There's more in DVD than the video. You can select audio track, subtitles, navigate through the menu, play interactive game or browse a gallery of still images.
I wanted to understand the logic in the JavaScript.
Also I don't do C and wasn't even able to compile the programs coming with libdvdread and libdvdnav on my PC... ^^;