title: Chromecast custom CAF receiver
body: <p>I'm having issues with the new CAF receiver not registering the YouTube iframe player as a player, and that it is playing. After 5 minutes connected to the receiver, the connection is broken because it thinks that the player is idle.</p>
  
  <p>This is the sender-code </p>
  
  <pre><code>var metadata = new chrome.cast.media.GenericMediaMetadata();
  metadata.title = "Foo - Bar";
  metadata.image = 'https://img.youtube.com/vi/IXNrHusLXoM/mqdefault.jpg';
  metadata.images = ['https://img.youtube.com/vi/IXNrHusLXoM/mqdefault.jpg'];
  var mediaInfo = new chrome.cast.media.MediaInfo();
  mediaInfo.contentType = "video/*";
  mediaInfo.contentId ="IXNrHusLXoM";
  mediaInfo.duration = 300;
  var request = new chrome.cast.media.LoadRequest();
  request.media = mediaInfo;
  request.customData = customData;
  request.metadata = metadata;
  castSession.loadMedia(request).then(
    function() {
        console.log('Load succeed');
    },
    function(errorCode) {
        console.log('Error code: ' + errorCode);
  });
  </code></pre>
  
  <p>The receiver code can be found here: <a href="https://github.com/zoff-music/zoff-chromecast-receiver/blob/feature/v3/receiver.js" rel="nofollow noreferrer">https://github.com/zoff-music/zoff-chromecast-receiver/blob/feature/v3/receiver.js</a></p>
  
  <p>Is there any way of having the new CAF receiver hook into the YouTube iframe player, or "manually" dispatch LOADED, BUFFERING, PLAYING, PAUSED, STOPPED events so that the receiver doesn't disconnect from the sender?</p>
  
  <p>Edit: with the above code, the PlayerState gets to the BUFFERING stage, but stops there. The promise with the log "Load succeed" is never triggered.</p>