2

I'm building an app and I wanted to use the Cast SDK.

I set everything up, But then I realized that the files I want to cast must be online (using URL) and I can't use my phone local files.

Does anyone know how to use local files in the Mediainfo.builder(..)?

Even a way to cast only the app's audio will help.

Thanks.

0

1 Answer 1

4

You need to include a small web server in your application and serve the media that you are interested within that web server. Then communicate with your receiver and send the URL of the media (that is being served through your embedded web server) to your receiver so it can play that. Since media it is being served from your mobile device, your web server needs to stay up for the whole duration of media.

6
  • So how can I use specific directory of the device as a web server/localhost link? How could I use that server without uploading the files manually and getting them from the device? Commented Jul 12, 2014 at 1:30
  • When you set up a web server, you would also set up what to serve. Look at the embedded webservers that are already out there, such as github.com/NanoHttpd/nanohttpd to learn how it can be done.
    – Ali Naddaf
    Commented Jul 12, 2014 at 1:32
  • Yes, but how I connect the server to my app and get only his files and showing them using network? Commented Jul 12, 2014 at 1:39
  • As I said, that is an embedded server in your app, it is not a separate application. Please read that project to see how it can be done, or search the net or even SO.
    – Ali Naddaf
    Commented Jul 12, 2014 at 1:50
  • I set the things up, but I couldn't find a way to serve files that are not HTML files (AKA media files)... Commented Jul 13, 2014 at 7:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.