IOS, Android and Chrome API • Objective-C, Swift (IOS), Java (Android) and HTML5/JavaScript (Chrome) Receiver App • No interactive elements • Only informational elements • Default Media, Styled Media or Custom Receiver • HTML5/JavaScript
Cordova plugin • Set of device discovery and connectivity methods • Works across multiple television platforms and protocols (among them, Google Chromecast™) • Powered by LG™ • v1.6 • Github : https://github.com/ConnectSDK/Connect-SDK-Cordova-Plugin • Website : http://www.connectsdk.com Warnings : There are some limitations with this plugin that you would not face if you used the real Google Cast SDK !
Send/Broadcast message to Sender App : • In Sender App, receive message from Receiver App : • Doc : http://connectsdk.com/docs/1-6-0/tv-web-app/create-connected-web-app/ • Github : https://github.com/ConnectSDK/Connect-SDK-JavaScript-Bridge window.connectManager.on('message', function(data) { console.log('Sender: ' + data.from); console.log('Message: ' + data.message); }); ConnectSDK JavaScript Bridge window.connectManager.sendMessage(to, 'This is a test message'); window.connectManager.sendMessage(to, { 'message' : 'This is a JSON test message' }); window.connectManager.broadcastMessage('This is a test message'); window.connectManager.broadcastMessage({ 'message' : 'This is a JSON test message' }); myWebAppSession.on('message', function (message) { console.log('Received message from web app:' + JSON.stringify(message)); });
Click on “Remote Debugging (AppEngine)” and click on the “shield icon” to load risky scripts : • Then you can acceed to Chrome Devtools of the Receiver Web App : Debug Receiver App
your Cast Receiver devices • Google Cast SDK Developper Console (https://cast.google.com/publish/) • For more informations: https://developers.google.com/cast/docs/registration Warning : When a Cast Receiver Device registration is finished, you need to restart the concerned Cast Device !
session : • Doc : http://connectsdk.com/docs/1-6-0/cordova/beam-media/ • Apis : ◦ http://connectsdk.com/apis/1-6-0/cordova/launchsession/ ◦ http://connectsdk.com/apis/1-6-0/cordova/mediaplayer/ ◦ http://connectsdk.com/apis/1-6-0/cordova/mediacontrol/ // Pause media myMediaControl.pause() // Play media myMediaControl.play(); // Seek to 10 seconds myMediaControl.seek(10); // Close media player myLaunchSession.close(); ConnectSDK Beam Media
messages : • Doc : http://connectsdk.com/docs/1-6-0/cordova/beam-web-apps/ • Apis : ◦ http://connectsdk.com/apis/1-6-0/cordova/webapplauncher/ ◦ http://connectsdk.com/apis/1-6-0/cordova/webappsession/ // Open a message channel to the web app myWebAppSession.connect(); // Close the message channel myWebAppSession.disconnect(); // Send a text to the web app (must be connected first) myWebAppSession.sendText('A message'); // Send a JSON object myWebAppSession.sendJSON({message: 'A message'}); // Close the web app myWebAppSession.close(); ConnectSDK Beam Web App