googlecast / CastVideos-android

Reference Android Sender w/ Framework API: CastVideos-android application shows how to cast videos from an Android device that is fully compliant with the Cast Design Checklist.
Apache License 2.0
345 stars 182 forks source link

Google ChromeCast Android does not run smoothly when using local http url #96

Open donglp1810 opened 4 years ago

donglp1810 commented 4 years ago

My app would like to integrate the Google Chromecast feature and it is similar to Google Photos app. It allows the user to browse files, then cast to chrome cast devices. Following this link: https://github.com/googlecast/CastVideos-android.

I had set up a local HTTP URL for my casting file like this URL below: http://192.168.1.45:8989/local/storage/emulated/0/DCIM/AnyRestore/20200908_113828.mp4 The result is video file is successfully cast, but it is usually interrupted, lag without any reason (although Wifi speed is very stable).

Then I had tried to hardcoding to change the global URL look similar to this one: https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/mp4/BigBuckBunny.mp4 like the sample app above. Magically it works and runs smoothly.

So this is my question:

  1. Can you help me answer what is the difference between using a local URL and a global URL which affect to ChromeCast process? Our app normally works in offline mode, so I prefer a local URL rather than a global URL.
  2. I recognized that the Google Photo app seems to use a local URL (not global URL) because when I forced this app to stop, the casting process is also stopped at the same time. Does anyone help me confirm this and explain how the Google Photo app handle the ChromeCast feature? It is very helpful to me.

Thank you so much for your help.