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

Support __onGCastApiAvailable #51

Open
Lindsay-Needs-Sleep opened this issue Sep 27, 2019 · 0 comments
Open

Support __onGCastApiAvailable #51

Lindsay-Needs-Sleep opened this issue Sep 27, 2019 · 0 comments

Comments

@Lindsay-Needs-Sleep
Copy link
Collaborator

It would be nice if we could implement chrome Api's method of signalling that the api is available.

In Chrome desktop you do:

window['__onGCastApiAvailable'] = function(isAvailable, err) {
  if (isAvailable) {
    // start using the api
  }
};

But in cordova-plugin-chromecast you do:

document.addEventListener("deviceready", function () {
    // start using the api
});

Would be nice to conform a bit more because:

  • less difference between our usage and chrome's = less documentation we have to write and maintain. :D
  • Allows identical code to be ported between web and cordova
    • (This happens to be my use-case. We use a remote web server which works from desktop and cordova.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant