Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromecast's always listed as DIAL? #17

Open
ds8k opened this issue May 26, 2015 · 9 comments
Open

Chromecast's always listed as DIAL? #17

ds8k opened this issue May 26, 2015 · 9 comments
Labels

Comments

@ds8k
Copy link

ds8k commented May 26, 2015

It seems like unless I recently casted something to my devices, ConnectSDK only detects them as DIAL devices.

@Andolamin
Copy link
Contributor

@ds8k This should be working correctly in the 1.6.0 release

@Andolamin Andolamin added the bug label Sep 9, 2015
@dayaki
Copy link

dayaki commented Mar 2, 2016

This seems not to be working yet.

@Gioggiolo
Copy link

Same issue here on android.. I'm going to try on iOS.

@ARDde
Copy link

ARDde commented Jul 28, 2016

Same issue on Android 5.1.1 and ConnectSDK 1.6.
If you run the Cordova-API-Sampler first, Chromecast always listed as DIAL. Hide the App an start another App with, also with ConnectSDK, Cromecasts listed as DIAL/Chromecast and it works.

@Sprotte
Copy link

Sprotte commented Aug 16, 2016

I have also the same Problem, is there any kind of workaround or hot fix for this problem, i m also using the 1.6?

@ARDde
Copy link

ARDde commented Aug 17, 2016

I have implemented a Hotfix. Replace this methode in CastDiscoveryProvider.java and everything is find.

@OverRide
public void onRouteChanged(MediaRouter router, RouteInfo route) {
super.onRouteChanged(router, route);

        CastDevice castDevice = CastDevice.getFromBundle(route.getExtras());
        String uuid = castDevice.getDeviceId();

        ServiceDescription foundService = foundServices.get(uuid);

        boolean isNew = foundService == null;
        boolean listUpdateFlag = false;

        /* ARD: Hotfix für Chromecast */
        if (isNew) {
            foundService = new ServiceDescription(CastService.ID, uuid,
                    castDevice.getIpAddress().getHostAddress());
            foundService.setFriendlyName(castDevice.getFriendlyName());
            foundService.setServiceID(CastService.ID);

            listUpdateFlag = true;

            isNew = false;
        }

        if (!isNew) {
            foundService.setIpAddress(castDevice.getIpAddress().getHostAddress());
            foundService.setModelName(castDevice.getModelName());
            foundService.setModelNumber(castDevice.getDeviceVersion());
            foundService.setModelDescription(route.getDescription());
            foundService.setPort(castDevice.getServicePort());
            foundService.setDevice(castDevice);

            if (!foundService.getFriendlyName().equals(castDevice.getFriendlyName())) {
                foundService.setFriendlyName(castDevice.getFriendlyName());
                listUpdateFlag = true;
            }

            foundService.setLastDetection(new Date().getTime());

            foundServices.put(uuid, foundService);

            if (listUpdateFlag) {
                for (DiscoveryProviderListener listenter: serviceListeners) {
                    listenter.onServiceAdded(CastDiscoveryProvider.this, foundService);
                }
            }
        }
    }

@Sprotte
Copy link

Sprotte commented Aug 17, 2016

Thank you really for your answer, but i still have one problem i cant locate these file "CastDiscoveryProvider" in the connect sdk cordova?

@phablulo
Copy link

thank you so much, @ARDde !
It worked for me

@mateusmirandaalmeida
Copy link

The above correction causes my app to close itself. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants