Chromecast HTML Button

Is it possible to trigger a chrome throw using the HTML button?

I wrote a web page that uses a custom receiver, and basically allows the user to show reports to the people’s room in the form of statistics / charts, but they see the controls on their screen.

However, since it is a COMPLETELY broadcast application, I want to show a button on a web page that shows when the user is not casting and then disappears when they are not cast.

So something like:

<button id="castStart" style="display:none;">Start</button> <button id="castStop" style="display:none;">Stop</button> 

And then some JS like:

 if( CASTAVAILBLE ) { if( CASTING ) { $('#castStart').hide(); $('#castStop').show(); } else { $('#castStart').show(); $('#castStop').hide(); } $('#castStart').on('click', function(e){ startCasting(); $('#castStart').hide(); $('#castStop').show(); }); $('#castStop').on('click', function(e){ sttopCasting(); $('#castStart').show(); $('#castStop').hide(); }); } 

So basically the plan is to hide and show the buttons based on when they are executed, and ONLY if they are ABLE for translation (i.e. extension of the extension).

Is it possible?


Update: it looks like I'm doing what I want: https://chrome.com/photowall , so this is possible!

+8
javascript jquery chromecast
source share
1 answer

Casting is part of the Chrome browser (i.e., “everything that’s not a web page,” not the “Chrome browser”).

If you look at displaying other content for desktop and cast versions, you can only get rid of css media requests

 @media tv { .only-visible-on-chromecast { /*or when a tv is used as a screen ¯\_(ツ)_/¯ */ display: block; } } 

If you are looking for a javascript implementation of casting functions, you might want to adapt the chrome technology package for use by the browser.

0
source share

All Articles