Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
How to Chromecast a file (not a link) with javascript

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!