I'm trying to stream a video from my server but it doesn't work or I may do it wrong :
My routes are defined like :
var fs = require('fs');
router.get('/', function(req, res) {
fs.readdir(__dirname + '/../public/videos', function(err, data){
res.render('videos', {files: data});
});
});
router.get('/:file', function(req, res) {
res.render('videofile', {file: req.params.file});
});
In my jade template file I have for video.jade :
ul
for file in files
li
p
a(href=file)= file
Actually it lists all videos in my video repertory.
and then for videofile.jade
video
source(src=file type="video/webm")
I want it to work on my iOS device but it doesn't ( it stays on the same page)
iOS does not support webm. H.264/AAC/MP3 codecs in an mp4 container is the "correct" format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With