Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda