title: DRM WideVine video not playing from android cast sender application
body: <p>I am using the following <strong>cast receiver</strong></p>
  
  <p>When I connect my android sender to chromecast device, it show a black screen and never plays video.</p>
  
  <p><a href="https://github.com/googlecast/CastReferencePlayer" rel="noreferrer">https://github.com/googlecast/CastReferencePlayer</a></p>
  
  <p>I'm setting <strong>licenseUrl</strong> for <strong>widevine</strong> in receiver as follow:</p>
  
  <pre><code>sampleplayer.CastPlayer.prototype.preloadVideo_ = function(mediaInformation) {
    this.log_('preloadVideo_');
    var self = this;
    var url = mediaInformation.contentId;
    var protocolFunc = sampleplayer.getProtocolFunction_(mediaInformation);
    if (!protocolFunc) {
      this.log_('No protocol found for preload');
      return false;
    }
    var host = new cast.player.api.Host({
      'url': url,
      'mediaElement': self.mediaElement_
    });
    host.onError = function() {
      self.preloadPlayer_.unload();
      self.preloadPlayer_ = null;
      self.showPreviewModeMetadata(false);
      self.displayPreviewMode_ = false;
      self.log_('Error during preload');
    };
        host.licenseUrl = event.data.customData.licenseUrl;
        self.preloadPlayer_ = new cast.player.api.Player(host);
        self.preloadPlayer_.preload(protocolFunc(host));
        return true;
      };
  </code></pre>
  
  <blockquote>
    <p>host.licenseUrl = event.data.customData.licenseUrl;</p>
  </blockquote>
  
  <p>I've hosted it on a https server which is registered on developers console. </p>
  
  <p>I'm passing custom data as <strong>licenseUrl</strong> in a json object.</p>
  
  <p>The code of my android sender setting <strong>media info</strong> is below.</p>
  
  <pre><code>private MediaInfo buildMediaInfo() {
          MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
          movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, "Subtitle");
          movieMetadata.putString(MediaMetadata.KEY_TITLE, "Title");
          jsonObj = new JSONObject();
          try{
              jsonObj.put("licenseUrl","https://wv.test.expressplay.com/hms/wv/rights/?ExpressPlayToken=token-value");
          }catch (JSONException e){
              Log.e(null,"Failed to add description to the json object", e);
          }
          /*drmModel.getData().getStreamURL()*/
          return new MediaInfo.Builder("https://pathOfMystream.mpd")
                  .setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
                  .setContentType("application/dash+xml")
                  .setMetadata(movieMetadata)
                  .setCustomData(jsonObj)
                  .setStreamDuration(player.getDuration()*1000)
                  .build();
      }
  </code></pre>
  
  <ul>
  <li><p>What changes are further required ?</p></li>
  <li><p>Do I need to edit receiver? If yes, then what edits are needed?</p></li>
  <li><p>Is the string name in <strong>customData</strong> <strong>"licenseUrl"</strong> needs to be<br>
  changed?</p></li>
  <li><strong>CORS is enabled</strong> on the S3 server which is hosting the video contents.</li>
  </ul>
  
  <p>Please help! I'm stuck here for more than a week.</p>
  
  <p>Thank you.</p>