Skip to content

Commit

Permalink
Parse ms:laurl from ContentProtection in DASH
Browse files Browse the repository at this point in the history
Issue:#3393

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201694813
  • Loading branch information
AquilesCanta authored and ojw28 committed Jun 22, 2018
1 parent 78d8330 commit b031c3d
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ protected int getContentType(Format format) {
protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)
throws XmlPullParserException, IOException {
String schemeType = null;
String licenseServerUrl = null;
byte[] data = null;
UUID uuid = null;
boolean requiresSecureDecoder = false;
Expand Down Expand Up @@ -389,7 +390,9 @@ protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)

do {
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");
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
} else if (data == null) {
Expand All @@ -409,8 +412,11 @@ protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)
}
}
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
SchemeData schemeData = uuid != null
? new SchemeData(uuid, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder) : null;
SchemeData schemeData =
uuid != null
? new SchemeData(
uuid, licenseServerUrl, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder)
: null;
return Pair.create(schemeType, schemeData);
}

Expand Down

0 comments on commit b031c3d

Please sign in to comment.