Chromecast - DevParty Torino 2014

Corley S.r.l.
Corley S.r.l.Corley S.r.l.
DEVPARTY
GOOGLE CHROMECAST AND ANGULARJS
Createdby /GianlucaArbezzano @gianarb
WHAT IS THIS?!
Chromecastis athumb-sized mediastreamingdevice thatplugs
into the HDMI porton your TV
SETUP
CHROMECAST.COM/SETUP
DEVELOPER PROGRAM
DEVELOPERS.GOOGLE.COM/CAST
SENDER
GOOGLE CAST SUPPORTS SENDER APPLICATIONS WRITTEN
FOR THE ANDROID, IOS, AND CHROME PLATFORMS.
RECEIVER
GOOGLE CAST SUPPORTS SENDER APPLICATIONS WRITTEN
FOR THE ANDROID, IOS, AND CHROME PLATFORMS.
MY CHROMECAST GENERIC SENDER
sendev-cast.gianarb.it/#/home
.run(['$window','$timeout','$rootScope','$q',functionrun($window,$timeout,$ro
otScope,$q){
/**
*Managehistory
*/
$rootScope.logs=[];
/**
*Castisready?!
*/
if(!$window.chrome.cast||!$window.chrome.cast.isAvailable){
vardef=$q.defer();
def.resolve(chrome.cast);
$rootScope.cast=def.promise;
}
}])
$rootScope.cast.then(function(cast){
$window.sessionRequest=newchrome.cast.SessionRequest(appId);
$rootScope.configuration.appId=appId;
varapiConfig=newchrome.cast.ApiConfig(
$window.sessionRequest,
$window.sessionListener,
$window.receiverListener
);
cast.initialize(
apiConfig,
function(event){
console.log("Good!");
},
function(event){
if(event){
console.log("D'oh");
}
}
);
});
$scope.cast=function(){
$rootScope.cast.then(function(cast){
cast.requestSession(function(e){
$window.session=e;
},function(){
console.log("ERROR");
});
});
};
WORK WITH BUS
$window.session.sendMessage(
namespace,
message,
function(e){
console.log("OK");
},
function(e){
console.log("error");
}
);
WORK WITH MEDIA
$scope.loadMedia=function(url)
{
varonMediaDiscovered=function(how,media){
console.log("newmediasessionID:"+media.mediaSessionId);
$scope.currentMedia=media;
};
$rootScope.cast.then(function(cast){
varmediaInfo=newcast.media.MediaInfo(url);
mediaInfo.contentType='video/mp4';
varrequest=newchrome.cast.media.LoadRequest(mediaInfo);
request.autoplay=true;
request.currentTime=0;
session.loadMedia(request,
onMediaDiscovered.bind(this,'loadMedia'),
function(e){
$rootScope.logs.push({
message:e,
type:"error"
});
}
);
});
};
BUS RECEIVER
varhandlers={
onReady:function(event){
$rootScope.$broadcast("$castOnReady",event);
session.setApplicationState("Applicationstatusisready...");
},
onSenderConnected:function(event){
statusConnect=true;
$rootScope.$broadcast("$castOnSenderConnected",event);
},
onSenderDisconnected:function(event){
$rootScope.$broadcast("$castOnSenderDisconnected",event);
if(session.getSenders().length===0){
window.close();
}
},
onSystemVolumeChanged:function(event){
$rootScope.$broadcast("$castOnSystemVolumeChanged",event);
},
onMessage:function(event){
$rootScope.$broadcast("$cast-urn:x-cast:com.corley.google.cast",even
t);
messageBus.send(event.senderId,event.data);
}
};
session=cast.receiver.CastReceiverManager.getInstance();
session.onSenderDisconnected=handlers.onSenderDisconnected;
session.onSenderConnected=handlers.onSenderConnected;
session.onSystemVolumeChanged=handlers.onSystemVolumeChanged;
session.onReady=handlers.onReady;
messageBus=session.getCastMessageBus('urn:x-cast:com.corley.google.cast');
messageBus.onMessage=handlers.onMessage;
THANKS AND GOOD PATY
1 of 15

Recommended

Play勉強会 playをGAEで動かそう! by
Play勉強会 playをGAEで動かそう!Play勉強会 playをGAEで動かそう!
Play勉強会 playをGAEで動かそう!Daisuke Kasuya
2.2K views44 slides
Winefontssmoothing en by
Winefontssmoothing enWinefontssmoothing en
Winefontssmoothing enmunjikuo
483 views2 slides
מחברת וירטואלית, ביולוגיה by
מחברת וירטואלית, ביולוגיהמחברת וירטואלית, ביולוגיה
מחברת וירטואלית, ביולוגיהתוכנית נחשון
279 views5 slides
Game development by
Game developmentGame development
Game developmentAsido_
402 views67 slides
מחברת וירטואלית, ביולוגיה, תש by
מחברת וירטואלית, ביולוגיה, תשמחברת וירטואלית, ביולוגיה, תש
מחברת וירטואלית, ביולוגיה, תשתוכנית נחשון
318 views8 slides
Dev party 2014 - AWS & JS by
Dev party 2014 - AWS & JSDev party 2014 - AWS & JS
Dev party 2014 - AWS & JSCorley S.r.l.
577 views22 slides

More Related Content

Similar to Chromecast - DevParty Torino 2014

The chromecast's guide to the galaxy by
The chromecast's guide to the galaxyThe chromecast's guide to the galaxy
The chromecast's guide to the galaxyRoc Boronat
4.8K views31 slides
State of Web APIs 2017 by
State of Web APIs 2017State of Web APIs 2017
State of Web APIs 2017Carsten Sandtner
374 views98 slides
Developing Desktop Applications using HTML and Javascript by
Developing Desktop Applications using HTML and JavascriptDeveloping Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and JavascriptJeff Haynie
8.2K views22 slides
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013 by
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Amazon Web Services
7.9K views67 slides
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V... by
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...Amazon Appstore Developers
742 views61 slides
The Modern Developer Toolbox by
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
2.6K views115 slides

Similar to Chromecast - DevParty Torino 2014(20)

The chromecast's guide to the galaxy by Roc Boronat
The chromecast's guide to the galaxyThe chromecast's guide to the galaxy
The chromecast's guide to the galaxy
Roc Boronat4.8K views
Developing Desktop Applications using HTML and Javascript by Jeff Haynie
Developing Desktop Applications using HTML and JavascriptDeveloping Desktop Applications using HTML and Javascript
Developing Desktop Applications using HTML and Javascript
Jeff Haynie8.2K views
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013 by Amazon Web Services
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013
Amazon Web Services7.9K views
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V... by Amazon Appstore Developers
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
The Modern Developer Toolbox by Pablo Godel
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel2.6K views
[rwdsummit2012] Adaptive Images in Responsive Web Design by Christopher Schmitt
[rwdsummit2012] Adaptive Images in Responsive Web Design[rwdsummit2012] Adaptive Images in Responsive Web Design
[rwdsummit2012] Adaptive Images in Responsive Web Design
Christopher Schmitt6.8K views
[convergese] Adaptive Images in Responsive Web Design by Christopher Schmitt
[convergese] Adaptive Images in Responsive Web Design[convergese] Adaptive Images in Responsive Web Design
[convergese] Adaptive Images in Responsive Web Design
Christopher Schmitt4.8K views
Non Conventional Android Programming En by guest9bcef2f
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
guest9bcef2f548 views
Non Conventional Android Programming (English) by Davide Cerbo
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
Davide Cerbo999 views
Composer for Busy Developers - php|tek13 by Rafael Dohms
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
Rafael Dohms11.1K views
[html5tx] Adaptive Images in Responsive Web Design by Christopher Schmitt
[html5tx] Adaptive Images in Responsive Web Design[html5tx] Adaptive Images in Responsive Web Design
[html5tx] Adaptive Images in Responsive Web Design
Christopher Schmitt5.3K views
Lights, Camera, Docker: Streaming Video at DramaFever by bridgetkromhout
Lights, Camera, Docker: Streaming Video at DramaFeverLights, Camera, Docker: Streaming Video at DramaFever
Lights, Camera, Docker: Streaming Video at DramaFever
bridgetkromhout3.1K views
[refreshaustin] Adaptive Images in Responsive Web Design by Christopher Schmitt
[refreshaustin] Adaptive Images in Responsive Web Design[refreshaustin] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
Christopher Schmitt33.2K views
Tools that help and speed up RWD dev by Matjaž Korošec
Tools that help  and speed up RWD devTools that help  and speed up RWD dev
Tools that help and speed up RWD dev
Matjaž Korošec4.8K views
[HEWEBAR 2012] Adaptive Images in Responsive Web Design by Christopher Schmitt
[HEWEBAR 2012] Adaptive Images in Responsive Web Design[HEWEBAR 2012] Adaptive Images in Responsive Web Design
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
Christopher Schmitt1.5K views
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St... by Atlassian
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Satellite Apps around the Cloud: Integrating your infrastructure with JIRA St...
Atlassian462 views

More from Corley S.r.l.

Aws rekognition - riconoscimento facciale by
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento faccialeCorley S.r.l.
313 views18 slides
AWSome day 2018 - scalability and cost optimization with container services by
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container servicesCorley S.r.l.
273 views34 slides
AWSome day 2018 - API serverless with aws by
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with awsCorley S.r.l.
203 views38 slides
AWSome day 2018 - database in cloud by
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloudCorley S.r.l.
195 views36 slides
Trace your micro-services oriented application with Zipkin and OpenTracing by
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing Corley S.r.l.
1.3K views46 slides
Apiconf - The perfect REST solution by
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solutionCorley S.r.l.
305 views14 slides

More from Corley S.r.l.(20)

Aws rekognition - riconoscimento facciale by Corley S.r.l.
Aws rekognition  - riconoscimento faccialeAws rekognition  - riconoscimento facciale
Aws rekognition - riconoscimento facciale
Corley S.r.l.313 views
AWSome day 2018 - scalability and cost optimization with container services by Corley S.r.l.
AWSome day 2018 - scalability and cost optimization with container servicesAWSome day 2018 - scalability and cost optimization with container services
AWSome day 2018 - scalability and cost optimization with container services
Corley S.r.l.273 views
AWSome day 2018 - API serverless with aws by Corley S.r.l.
AWSome day 2018  - API serverless with awsAWSome day 2018  - API serverless with aws
AWSome day 2018 - API serverless with aws
Corley S.r.l.203 views
AWSome day 2018 - database in cloud by Corley S.r.l.
AWSome day 2018 -  database in cloudAWSome day 2018 -  database in cloud
AWSome day 2018 - database in cloud
Corley S.r.l.195 views
Trace your micro-services oriented application with Zipkin and OpenTracing by Corley S.r.l.
Trace your micro-services oriented application with Zipkin and OpenTracing Trace your micro-services oriented application with Zipkin and OpenTracing
Trace your micro-services oriented application with Zipkin and OpenTracing
Corley S.r.l.1.3K views
Apiconf - The perfect REST solution by Corley S.r.l.
Apiconf - The perfect REST solutionApiconf - The perfect REST solution
Apiconf - The perfect REST solution
Corley S.r.l.305 views
Apiconf - Doc Driven Development by Corley S.r.l.
Apiconf - Doc Driven DevelopmentApiconf - Doc Driven Development
Apiconf - Doc Driven Development
Corley S.r.l.202 views
Authentication and authorization in res tful infrastructures by Corley S.r.l.
Authentication and authorization in res tful infrastructuresAuthentication and authorization in res tful infrastructures
Authentication and authorization in res tful infrastructures
Corley S.r.l.278 views
Flexibility and scalability of costs in serverless infrastructures by Corley S.r.l.
Flexibility and scalability of costs in serverless infrastructuresFlexibility and scalability of costs in serverless infrastructures
Flexibility and scalability of costs in serverless infrastructures
Corley S.r.l.174 views
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application by Corley S.r.l.
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.325 views
A single language for backend and frontend from AngularJS to cloud with Clau... by Corley S.r.l.
A single language for backend and frontend  from AngularJS to cloud with Clau...A single language for backend and frontend  from AngularJS to cloud with Clau...
A single language for backend and frontend from AngularJS to cloud with Clau...
Corley S.r.l.349 views
AngularJS: Service, factory & provider by Corley S.r.l.
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
Corley S.r.l.1.5K views
The advantage of developing with TypeScript by Corley S.r.l.
The advantage of developing with TypeScript The advantage of developing with TypeScript
The advantage of developing with TypeScript
Corley S.r.l.1.3K views
Angular coding: from project management to web and mobile deploy by Corley S.r.l.
Angular coding: from project management to web and mobile deployAngular coding: from project management to web and mobile deploy
Angular coding: from project management to web and mobile deploy
Corley S.r.l.893 views
Corley cloud angular in cloud by Corley S.r.l.
Corley cloud   angular in cloudCorley cloud   angular in cloud
Corley cloud angular in cloud
Corley S.r.l.801 views
Measure your app internals with InfluxDB and Symfony2 by Corley S.r.l.
Measure your app internals with InfluxDB and Symfony2Measure your app internals with InfluxDB and Symfony2
Measure your app internals with InfluxDB and Symfony2
Corley S.r.l.4.5K views
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda by Corley S.r.l.
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS LambdaRead Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Read Twitter Stream and Tweet back pictures with Raspberry Pi & AWS Lambda
Corley S.r.l.3.6K views
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L... by Corley S.r.l.
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Deploy and Scale your PHP App with AWS ElasticBeanstalk and Docker- PHPTour L...
Corley S.r.l.6.3K views
Middleware PHP - A simple micro-framework by Corley S.r.l.
Middleware PHP - A simple micro-frameworkMiddleware PHP - A simple micro-framework
Middleware PHP - A simple micro-framework
Corley S.r.l.8.3K views

Recently uploaded

Unleash The Monkeys by
Unleash The MonkeysUnleash The Monkeys
Unleash The MonkeysJacob Duijzer
8 views28 slides
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...Marc Müller
40 views62 slides
Short_Story_PPT.pdf by
Short_Story_PPT.pdfShort_Story_PPT.pdf
Short_Story_PPT.pdfutkarshsatishkumarsh
5 views16 slides
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptxanimuscrm
15 views19 slides
MS PowerPoint.pptx by
MS PowerPoint.pptxMS PowerPoint.pptx
MS PowerPoint.pptxLitty Sylus
5 views14 slides
WebAssembly by
WebAssemblyWebAssembly
WebAssemblyJens Siebert
51 views18 slides

Recently uploaded(20)

.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller40 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h... by Deltares
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
DSD-INT 2023 Exploring flash flood hazard reduction in arid regions using a h...
Deltares9 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action by Márton Kodok
Gen Apps on Google Cloud PaLM2 and Codey APIs in ActionGen Apps on Google Cloud PaLM2 and Codey APIs in Action
Gen Apps on Google Cloud PaLM2 and Codey APIs in Action
Márton Kodok6 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski10 views

Chromecast - DevParty Torino 2014