Chromecast, CheapCast and TV - DevFest Brussels 2013

36
Chromecast, Cheapcast and TV Sebastian Mauer GDG Aachen DevFest Brussels November 16th, 2013

description

Is GoogleTV doomed? Will Chrome is in Chromecast? Learn how Google's Chromecast works on the inside.

Transcript of Chromecast, CheapCast and TV - DevFest Brussels 2013

Page 1: Chromecast, CheapCast and TV - DevFest Brussels 2013

Chromecast, Cheapcast and TV

Sebastian Mauer GDG Aachen

DevFest Brussels November 16th, 2013

Page 2: Chromecast, CheapCast and TV - DevFest Brussels 2013

This Presentation contains QR-Codes

Page 3: Chromecast, CheapCast and TV - DevFest Brussels 2013

Who am I?Sebastian MauerGDG Aachen Co-Lead CS StudentSoftware Engineer I don’t work for Google…yet

Page 4: Chromecast, CheapCast and TV - DevFest Brussels 2013

Part I: Google TV

Page 5: Chromecast, CheapCast and TV - DevFest Brussels 2013

GoogleTV

• Google’s first attempt to „own“ the TV

• Introduced at Google I/O 2010

• First Device, x86-based Logitech Revue

• US only at launch

Page 6: Chromecast, CheapCast and TV - DevFest Brussels 2013

By the summer of 2012, the majority of the televisions you see in stores will

have Google TV embedded.- Eric Schmidt at LeWeb 2011

Page 7: Chromecast, CheapCast and TV - DevFest Brussels 2013

GoogleTV

http://9to5mac.com/2013/07/16/report-at-56-apple-tv-takes-majority-of-streaming-device-marketshare-in-2012/

Page 8: Chromecast, CheapCast and TV - DevFest Brussels 2013

Three Generations1. Generation, late 2010 based on Android 3.2

2. Generation, Summer 2012 based on Android 3.2

3. Generation, 2013 probably on Android 4.2.2

Page 9: Chromecast, CheapCast and TV - DevFest Brussels 2013

GoogleTV: Pros

• Part of the Android-family.

• Deploying apps is easy™ (via Play Store)

• Re-use most of your existing Android code

Page 10: Chromecast, CheapCast and TV - DevFest Brussels 2013

GoogleTV: Cons

• Does not evolve as fast as mainline Android

• Not many devices sold (500,000 - 1,000,000)

• Late start in the European Union (2012)

Page 11: Chromecast, CheapCast and TV - DevFest Brussels 2013

Help me Android. You're my only hope

Page 12: Chromecast, CheapCast and TV - DevFest Brussels 2013

Part II: ChromeCastaka Google Cast Devices

Page 13: Chromecast, CheapCast and TV - DevFest Brussels 2013
Page 14: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: Hardware

• Model Number: H2G2-42

• It’s not based on ChromeOS

• It’s based on Android and Chromium

• It’s not going to kill GoogleTV

http://www.ifixit.c

om/Tea

rdow

n/Chrom

ecas

t+Te

ardo

wn/16

069

Page 15: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: Pros

• Very cheap hardware (35$)

• Very easy to use (My Grandma can do it™)

• Web Developers can easily write „Receiver“-Apps

• Simple Protocol Stack

Page 16: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: Cons

• Google Cast SDK is still a Developer Preview(read: things will break, things will change)

• You have to manually whitelistall your apps with Google

• It’s not officially released outside the U.S.

Page 17: Chromecast, CheapCast and TV - DevFest Brussels 2013

WebTech

UDP

ChromeCast: Protocol Stack• SSDP (Simple Service Discovery Protocol)

• DIAL (DIscovery And Launch)

• RAMP (Remote Application Media Protocol)

• HTML5 & JS (You know that this is)

• WebSockets (Bi-directional communication Browser<>WebApp)

• WebRTC (Web Real Time Communication)

Page 18: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: How does it work?

Page 19: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: How it works!1. Advertises ChromeCast

using SSDP (UDP Broadcast)

!2. Discovers Endpoints using DIAL

!!

3. Requests App and opens WebSocket connection

!!!

4. CC fetches HTML5 based 1st Screen App (opens WebSocket)

Page 20: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: How it works! II!!!!

5. Sends request to play media

!!!!!

6. HTML5 app receivesmedia request (WebSocket) starts fetching content.

!!!!!!

7. Media is downloaded/streamed by ChromeCast device

Page 21: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: DIAL

• Protocol published by Netflix

• Uses SSDP for Service Announcement

• DIAL REST WebService for exchanging Device capabilities and controlling

Page 22: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: DIAL

SearchSSDP

DiscoverySSDP

CapabilitiesHTTP

StartHTTP

Page 23: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast: Sender App

• Cast SDK available for

• Needs Whitelisting with Google

Page 24: Chromecast, CheapCast and TV - DevFest Brussels 2013

<html> <script src="https://www.gstatic.com/cast/js/receiver/1.0/cast_receiver.js"> </script> <script type="text/javascript"> ! var receiver = new cast.receiver.Receiver( 'App ID', [cast.receiver.RemoteMedia.NAMESPACE], "", 5); var remoteMedia = new cast.receiver.RemoteMedia(); remoteMedia.addChannelFactory( receiver.createChannelFactory(cast.receiver.RemoteMedia.NAMESPACE)); ! receiver.start(); ! window.addEventListener('load', function() { var elem = document.getElementById('vid'); remoteMedia.setMediaElement(elem); }); !</script> <body> <video id="vid" style="position:absolute;top:0;left:0;height:100%;width:100%" /> </body> </html>

ChromeCast: Receiver App

Page 25: Chromecast, CheapCast and TV - DevFest Brussels 2013

ChromeCast is not just for „streaming“ content.

Page 26: Chromecast, CheapCast and TV - DevFest Brussels 2013

It’s a remote controllable Chrome Browser running on your TV.

Page 27: Chromecast, CheapCast and TV - DevFest Brussels 2013

Part III: CheapCast*

* includes shameless plug

Page 28: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast all the Droids• Is an app that emulates a

ChromeCast (or Google Cast) device on almost any Android Device

• Implements DIAL, RAMP/WS Proxy-ing

• Does not care if your id is whitelisted or not.

• Written by me

Page 29: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast: Components

WebView

SSDP Service

DIAL REST WS

ChromeCast API Ext

1st Screen Output

Receiver App

Sender App

Page 30: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast: Use Cases

• Start developing ChromeCast apps without owningan actual ChromeCast Device

• Turn one of your old Android-devices into aChromeCast Dongle (connect via MHL<->HDMI)

• Cast content from your Android Smartphoneto your Android Tablet just for the hell of it.

Page 31: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast: Use Cases

Google Music

YouTube

Page 32: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast

Page 33: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast: OpenSource

https://github.com/mauimauer/cheapcast Licensed under the Apache 2.0 License

Upcoming Feature:

Tab Casting!Made possible by Chromium

Page 34: Chromecast, CheapCast and TV - DevFest Brussels 2013

Demo

Page 35: Chromecast, CheapCast and TV - DevFest Brussels 2013

CheapCast: Get it now

Page 36: Chromecast, CheapCast and TV - DevFest Brussels 2013

Q&A