Is there a way to somehow recognize a type of Cast device, to which my application is connected? (e.g. Chromecast, Nexus, Player, etc.)
I am using CastCompanionLibrary. The logic about connecting and disconnecting is in this library. In my fragment, in onCreateOptionsMenu
, I have only this line of code:
mCastManager.addMediaRouteButton(menu, R.id.media_route_menu_item);
mCastManager
is instance of class VideoCastManager
. I would like to generally solution for my question.
First of all, is it possible to recognize the device?
Thanks for help.
UPDATE
The reason why I need to recognize the device is very simple. Everything is about MPD manifests. It exists more than one manifest type and we use Time-Based Segment
manifest. With this manifest everything works fine on Chromecast for example.
However, there is a problem with this manifest on Nexus Player, because the seeking is broken on this type of device. So, I need to know the device type to inform user, that this is a chance that seeking will not work properly.
The Segment-Base
manifest works fine with Nexus Player, but it is very time consuming to encode all of our video (Time-Based Segment
) to Segment Base
manifest.
In general, we do not want to create an ecosystem where some apps run on one cast device and not on others. So my question for you is why you would need to recognize the type of device that you are running on? In those cases that devices are very different (for example a cast-enabled speaker vs Chromecast), we have "capabilities" apis to allow such differentiation.