mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Parse ms:laurl from ContentProtection in DASH
Issue:#3393 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201694813
This commit is contained in:
parent
0a80b47edb
commit
a37bd0d66f
1 changed files with 9 additions and 3 deletions
|
|
@ -355,6 +355,7 @@ public class DashManifestParser extends DefaultHandler
|
||||||
protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)
|
protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)
|
||||||
throws XmlPullParserException, IOException {
|
throws XmlPullParserException, IOException {
|
||||||
String schemeType = null;
|
String schemeType = null;
|
||||||
|
String licenseServerUrl = null;
|
||||||
byte[] data = null;
|
byte[] data = null;
|
||||||
UUID uuid = null;
|
UUID uuid = null;
|
||||||
boolean requiresSecureDecoder = false;
|
boolean requiresSecureDecoder = false;
|
||||||
|
|
@ -389,7 +390,9 @@ public class DashManifestParser extends DefaultHandler
|
||||||
|
|
||||||
do {
|
do {
|
||||||
xpp.next();
|
xpp.next();
|
||||||
if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
|
if (XmlPullParserUtil.isStartTag(xpp, "ms:laurl")) {
|
||||||
|
licenseServerUrl = xpp.getAttributeValue(null, "licenseUrl");
|
||||||
|
} else if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
|
||||||
String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
|
String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
|
||||||
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
|
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
|
||||||
} else if (data == null) {
|
} else if (data == null) {
|
||||||
|
|
@ -409,8 +412,11 @@ public class DashManifestParser extends DefaultHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
|
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
|
||||||
SchemeData schemeData = uuid != null
|
SchemeData schemeData =
|
||||||
? new SchemeData(uuid, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder) : null;
|
uuid != null
|
||||||
|
? new SchemeData(
|
||||||
|
uuid, licenseServerUrl, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder)
|
||||||
|
: null;
|
||||||
return Pair.create(schemeType, schemeData);
|
return Pair.create(schemeType, schemeData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue