Ich bin mit dem folgenden Guss EmpfängerDRM Widevine Video nicht von Android-Guss Absender Anwendung spielt
Wenn ich meine Android-Sender verbinden Gerät Chrome, zeigen sie einen schwarzen Bildschirm und spielen nie Video.
https://github.com/googlecast/CastReferencePlayer
I licenseUrl für Widevine in Empfänger wie folgt bin Einstellung:
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;
};
host.licenseUrl = event.data.customData.licenseUrl;
Ich habe es auf einem https-Server gehostet, der auf der Entwicklerkonsole registriert ist.
Ich übergebe benutzerdefinierte Daten wie licenseUrl in einem JSON-Objekt.
Der Code meiner Android-Absender Einstellung Media Info ist unten.
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();
}
Welche Änderungen sind weiter erforderlich?
Muss ich den Empfänger bearbeiten? Wenn ja, welche Änderungen werden benötigt?
Ist string name in custom"licenseUrl"
geändert werden muss?- CORS ist aktiviert auf dem S3-Server, der die Videoinhalte hostet.
Bitte helfen! Ich stecke hier für mehr als eine Woche fest.
Vielen Dank.