I've an issue with a Chromecast app I'm working on. It's an app for Chrome (not for iOS or Android).
I can't figure out why mp3 files aren't loaded by my chromecast device while mp4 are (for the record, I'm using the default receiver).
I based my work on this official sample : https://github.com/googlecast/CastVideos-chrome
Here you can see the code : http://pastebin.com/nJGeT7xP
Here is how I send the mp3 file :
if (session) {
var mediaInfo = new chrome.cast.media.MediaInfo("http://localhost/tom_www/CastTom/music.mp3", "audio/mpeg");
var request = new chrome.cast.media.LoadRequest(mediaInfo);
session.loadMedia(
request,
onMediaDiscovered.bind(this, 'loadMedia'),
onMediaError
);
} else {
console.log("No session available, connect first");
}
I hope you can help me.
Thank you.
You will need to put the mp3 in a location accessible to the chromecast. You can do this by getting the the ipaddress of your chrome device to send to the chromecast or placing the mp3 on a publicly accessible server.