如上一个答案之一所述,您应该检查 6028 错误代码
要解决这个问题(在持久许可证过期的情况下),我们需要使用 MediaFailed >event handler。在handler中,如果错误码是6028,我们只需要使用LicenseAcquirer >获取license即可。LicenseAcquirer 可以是自定义 LicenseAcquirer 或 SSME 的默认 >LicenseAcquirer。
如下例所示,我们使用了自定义许可证获取器。
protected void OnMediaFailed(object sender, CustomEventArgs<Exception> e)
{
if (e.Value.Message.StartsWith("6028"))
{
//Get Manifest Info Somehow
........
//our custom acquirer initialization
var acquirer = new ManualLicenseAcquirer();
if (manifestInfo != null
&& manifestInfo.ProtectionInfo != null
&& manifestInfo.ProtectionInfo.ProtectionHeader != null)
{
acquirer.AcquireLicenseCompleted += this.OnLAcquirerCompleted;
acquirer.AcquireLicenseAsync(manifestInfo.ProtectionInfo.ProtectionHeader.ProtectionData);
}
else
{
this.ShowCustomError("Manifest info is null or protection header is null", true, true);
}
}
private void OnLAcquirerCompleted(object sender, AcquireLicenseCompletedEventArgs e)
{
if (e.Error != null)
{
this.ShowCustomError(string.Format("Server response error: {0}", e.Error), true, true);
}
else if (e.Cancelled)
{
this.ShowCustomError(string.Format("Manual license acquier request was cancelled"), true, true, true);
}
else
{
this.Play();
}
}