Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cast - Cannot Resolve mSelectedDevice

I am having a problem making a Google Cast Service. I can not seem to find what to use for mSelectedDevice. Both tutorials that I am using do not provide enough explanation for this, and neither go into detail of what mSelectedDevice should be.

public class CastMediaRouterCallback extends MediaRouter.Callback{

@Override
public void onRouteSelected(MediaRouter router, MediaRouter.RouteInfo info) {
    mSelectedDevice = CastDevice.getFromBundle(info.getExtras());
    String routeId = info.getId();
    //Startd NanoHTTPD, Find URI of photo/video, and display on Cast device
}

@Override
public void onRouteUnselected(MediaRouter router, MediaRouter.RouteInfo info) {
    teardown();
    mSelectedDevice = null;
}

}

(Tutorials I am using: https://developers.google.com/cast/docs/android_sender /// https://www.binpress.com/tutorial/building-an-android-google-cast-sender-app/161)

like image 501
pancodemakes Avatar asked Jul 08 '26 09:07

pancodemakes


1 Answers

mSelecteDevice is an instance variable that is of type CastDevice. Not sure what you mean by "Google Cast Service" in your question but it seems you might be better off grabbing a sample project from oue GitHub repo as your starting point.

like image 177
Ali Naddaf Avatar answered Jul 09 '26 23:07

Ali Naddaf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!