title: Chromecast subtitles on default receiver applications
body: <p>I am trying to include subtitles on a Chromecast application I'm building. </p>
  
  <ol>
  <li>I am using the default receiver application. </li>
  <li>I am writing a chrome sender application using v1 of the chrome sender api. </li>
  </ol>
  
  <p>According to the <a href="https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track" rel="nofollow">Chromecast Sender Api documentation</a>, I should be passing in an array of track objects into the chrome.cast.media.MediaInfo object. My issue is, whenever I call <code>chrome.cast.media.Track(trackId, trackType)</code>, it returns undefined. When I look through the public methods in <code>chrome.cast.media</code>, through console, I don't see anything related to Track. Link to documentation <a href="https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.Track" rel="nofollow">here</a>. </p>
  
  <p>Below is my loadMedia method where I try to include an array of track objects along with my <code>LoadRequest</code> as specified by the cast api. The commented out code is how I've seen closed-captioning handled in one of the cast Github repositories, but unfortunately I believe you have to handle that customData in your own custom receiver application.</p>
  
  <p>Are subtitles through the chrome sender SDK possible yet, or does one have to build their own receiver application and specifically handle text tracking through passed in customData? Am I potentially using the wrong sender api?</p>
  
  <pre><code>function loadMedia() {
    mediaUrl = decodeURIComponent(_player.sources.mp4);
    var mediaInfo = new chrome.cast.media.MediaInfo(mediaUrl);
    mediaInfo.contentType = 'video/mp4';
  
    var track1 = new chrome.cast.media.Track(1, chrome.cast.media.TrackType.TEXT);
    track1.trackContentId = "https://dl.dropboxusercontent.com/u/35106650/test.vtt";
  
    mediaInfo.tracks = [track1];
    var request = new chrome.cast.media.LoadRequest(mediaInfo);
  
    // var json = {
    //   cc: {
    //     tracks: [{
    //       src: "https://dl.dropboxusercontent.com/u/35106650/test.vtt"
    //     }],
    //     active: 0
    //   }
    // };
  
    // request.customData = json;
    session.loadMedia(request, onMediaDiscovered.bind(this, 'loadMedia'), onMediaError);
  }
  </code></pre>