Reputation: 640
Okay so i'm developing an application that supports casting local media to your chrome cast. So far i have connected to my device and have streamed a sample video but I'm know struggerling with streaming local files such as .MP4/.MP3 files that are located in the documents directory of my application. I have tried to use the URL of my file instead of the sample video. However this does not work. I believe this is due to the fact the file path is not within at http:// format however I'm not sure. If i am correct in thinking this How can i get round it?
Here is the code I'm using to stream the google sample video to the chrome cat:
GCKMediaInformation *mediaInformation =
[[GCKMediaInformation alloc] initWithContentID:
@"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
streamType:GCKMediaStreamTypeNone
contentType:type
metadata:metadata
streamDuration:0
customData:nil];
Thanks In Advance...
Upvotes: 1
Views: 1874
Reputation: 640
The answer is reasonably simple in the end you just need to serve your files to a http server and play them from there. I used CocoaHTTPServer
Upvotes: 3
Reputation: 1082
Chromecast is accessing shared media through the network. Thus, you should run http server inside your app to provide streaming access to the shared media. It won't work with local file URLs because most probably they are not accessible from the other devices within your network.
Upvotes: 0