mafintosh/chromecasts

Express.js not receiving player requests

Opened this issue · 0 comments

I will definitely not claim to understand how this all works, but here is a few ways i tried it.

I have two routes.

/server-video/:id
-> This one streams buffers to my HTML5 video player. This works really well for my Video Tag! So far everything besides the Chromecast aspect of this is fantastic! I thought i would have to send this buffer stream to the Chromecast.

and

/download-video/:id
-> This is a straight out download res.

router.get('/download-video/:id', function(req, res, next){
	var file = PATH +'/public/videos/test.mp4';
	console.log(file);
  	res.sendFile(file); // Set disposition and send it.res.download()
}); 

This works great when i just go to my browser and hit that URL. However, when i fire off this call.

var options = { title: movie_name, type: 'video/mp4' };

chromecasts.players[list['The Highway TV']].play("http://localhost:3000/video-play/"+req.params.id, options);
chromecasts.players[list['The Highway TV']].play("http://localhost:3000/download-video/"+req.params.id, options);

This causes my chromecast called "The Highway TV" (I made a mapping for the names to Indexes) flicker with the proper title...but i never actually receive a request of any type to my express instance. I was hoping to dig a bit more, but i can't seem to find anything which points to why that request wouldn't be making it through.

Any ideas? I am hoping to use this repo with my repo! So far, this is the best one i have found (It actually allowed me to see my chromecasts. So that was huge by itself!)