Reputation: 41
We have an Android-App and an iOS-App, both are not native apps, they are build with Apache Cordova. In the documentation for the Chromecast Sender Apps, I see that the lifecycle in the Google Cast SDK for Android and for iOS is different. Now we are wondering, if it is possible to use a Cordova-Plugin that will work for Android and for iOS.
Do you have some experience, how to integrate the Chromecast-API with Cordova. Do you know plugins, that we could use? Or would you generally recommend to use the Chromecast APIs only in native apps? Do you see any technical problems to integrate the chromecast functionality in an app, that is build with Cordova, that only displays the mobile webpage?
In worst case I see three different "applications" that we have to implement. One for Android, one or iOS and one for the desktop. The third one, only if we want to support the chrome-browser with its chromcast-plugin, too. Do you agree with that?
Upvotes: 4
Views: 2107
Reputation: 1798
There are a couple of solutions that bridge the gap between Cordova/Phonegap and Cast native functionality, providing a JavaScript API layer over the native libraries. Here's one example. You'll either need to use a plug-in like this (if you can get it to work -- there's pretty much no documentation) or write your own plug-ins using Java and Objective-C that essentially relay Chromecast functionality to Cordova.
Upvotes: 0
Reputation: 19034
I haven't worked with Cordova much, but my limited understanding is that they have a native shell/container. Before I get into details, I would say that using native clients makes your life much easier. With that said, what you can potentially do is the following:
As you can see, you need to duplicate a lot of logic and keep the two worlds in sync. Is it doable? I believe so, but it is a costly activity. The implementation of native part is clearly platform dependent.
Upvotes: 1