title: Chromecast HTML button
body: <p>Is it possible to call chrome cast via a HTML button?</p>
  
  <p>I've written a web page that uses a custom receiver and basically allows a user to show reports to a room of people in the form of stats/charts, but they see controls on their screen.</p>
  
  <p>However because this is PURELY a cast app, I want to show a button on the webpage that shows when the user isn't casting and then disappears when they are not casting.</p>
  
  <p>So something like:</p>
  
  <pre><code>&lt;button id="castStart" style="display:none;"&gt;Start&lt;/button&gt;
  &lt;button id="castStop" style="display:none;"&gt;Stop&lt;/button&gt;
  </code></pre>
  
  <p>And then some JS like:</p>
  
  <pre><code>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();
      });
  }
  </code></pre>
  
  <p>So basically the plan is to hide and show the buttons based on when they are casting and ONLY if they are ABLE to cast (i.e. the cast extension is installed).</p>
  
  <p>Is this possible?</p>
  
  <hr>
  
  <p>Update: This seems to do what I want: <a href="https://chrome.com/photowall">https://chrome.com/photowall</a> <strong>so it is possible!</strong></p>