├── tests ├── README.md └── tests.js ├── src └── android │ ├── ChromecastException.java │ ├── ChromecastOnMediaUpdatedListener.java │ ├── ChromecastSessionCallback.java │ ├── ChromecastOnSessionUpdatedListener.java │ ├── ChromecastMediaRouterCallback.java │ ├── ChromecastMediaController.java │ ├── ChromecastSession.java │ └── Chromecast.java ├── README.md ├── plugin.xml ├── .gitignore ├── EventEmitter.js └── chrome.cast.js /tests/README.md: -------------------------------------------------------------------------------- 1 | See cordova-labs cdvtest branch if interested in autotests 2 | -------------------------------------------------------------------------------- /src/android/ChromecastException.java: -------------------------------------------------------------------------------- 1 | package acidhax.cordova.chromecast; 2 | 3 | public class ChromecastException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/android/ChromecastOnMediaUpdatedListener.java: -------------------------------------------------------------------------------- 1 | package acidhax.cordova.chromecast; 2 | 3 | import org.json.JSONObject; 4 | 5 | public interface ChromecastOnMediaUpdatedListener { 6 | void onMediaLoaded(JSONObject media); 7 | void onMediaUpdated(boolean isAlive, JSONObject media); 8 | } -------------------------------------------------------------------------------- /src/android/ChromecastSessionCallback.java: -------------------------------------------------------------------------------- 1 | package acidhax.cordova.chromecast; 2 | 3 | public abstract class ChromecastSessionCallback { 4 | public void onSuccess() { 5 | onSuccess(null); 6 | } 7 | abstract void onSuccess(Object object); 8 | abstract void onError(String reason); 9 | } -------------------------------------------------------------------------------- /src/android/ChromecastOnSessionUpdatedListener.java: -------------------------------------------------------------------------------- 1 | package acidhax.cordova.chromecast; 2 | 3 | import org.json.JSONObject; 4 | 5 | public interface ChromecastOnSessionUpdatedListener { 6 | void onSessionUpdated(boolean isAlive, JSONObject properties); 7 | void onMessage(ChromecastSession session, String namespace, String message); 8 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cordova-chromecast 2 | ================== 3 | 4 | Chromecast in Cordova 5 | 6 | ##Installation 7 | For now, add the plugin from this repository, we'll publish soon with more progress. 8 | 9 | ``` 10 | cordova plugin add https://github.com/GetVideostream/cordova-chromecast.git 11 | ``` 12 | 13 | If you have NodeJS installed, the dependencies should be automatically copied. 14 | 15 | - `http://nodejs.org/` 16 | 17 | If not you will need to import the following projects as Library Projects in order for this plugin to work: 18 | 19 | - `adt-bundle\sdk\extras\google\google_play_services\libproject\google-play-services_lib` 20 | - `adt-bundle\sdk\extras\android\support\v7\appcompat` 21 | - `adt-bundle\sdk\extras\android\support\v7\mediarouter` 22 | 23 | ##Usage 24 | 25 | This project attempts to implement the official Google Cast SDK for Chrome... in Cordova. We've made a lot of progress in making this possible, check out the offical docs for examples: https://developers.google.com/cast/docs/chrome_sender 26 | 27 | When you call `chrome.cast.requestSession()` an ugly popup will be displayed to select a Chromecast. If you're not cool with this - you can call: `chrome.cast.getRouteListElement()` which will return a `