I want to create a program that casts a file with subtitles using javascript
const ChromecastAPI = require('chromecast-api')
const client = new ChromecastAPI()
client.on('device', function (device) {
if(device.friendlyName === "S70PCI" ){
**//this one works**
var mediaURL = "http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4"
**//this one doesn't work**
var mediaURL = "file:///E:/Download/Movies/Curb.Your.Enthusiasm.S11E02.1080p.WEB.H264-GGWP[TGx]/curb.your.enthusiasm.s11e02.1080p.web.h264-ggwp.mp4"
console.log("Playting the device:")
device.play(mediaURL, function (err){
if(!err) {
console.log("Playing success")}
else{
console.log(err, "run into an error while trying to play ", device.friendlyName)}
})
}
})
When I play a link to the tv it works fine, but when I it using a file path I get an error:
[1] Error: Load failed
I guess it fails because it just tells the TV the enter the link and not actually stream it from the computer, and the file doesn't exist on the web...
Is there any way I could stream the file to a link/webpage or stream it directly from my computer?
thanks for helping!