-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support parsing of license server URL from DASH manifest #3393
Comments
Can you please provide the full manifest, so we can see what's provided there? The url may be provided in more than once place (possibly in encoded form). What happens if you pass |
@ARKMe my service uses Azure Media Service too. AzureDashManifestpublic class AzureDashManifest extends DashManifest {
public final String drmLicenseUrl;
public AzureDashManifest(long availabilityStartTime, long duration, long minBufferTime,
boolean dynamic, long minUpdatePeriod, long timeShiftBufferDepth,
long suggestedPresentationDelay, UtcTimingElement utcTiming,
Uri location, String drmLicenseUrl, List<Period> periods) {
super(availabilityStartTime, duration, minBufferTime, dynamic, minUpdatePeriod,
timeShiftBufferDepth, suggestedPresentationDelay, utcTiming, location, periods);
this.drmLicenseUrl = drmLicenseUrl;
}
} AzureDashManifestParser// abstract code
public class AzureDashManifestParser extends DashManifestParser {
private String drmLicenseUrl = null;
@Override
protected AzureDashManifest buildMediaPresentationDescription(...) {
return new AzureDashManifest(availabilityStartTime, durationMs, minBufferTimeMs,
dynamic, minUpdateTimeMs, timeShiftBufferDepthMs, suggestedPresentationDelayMs, utcTiming,
location, drmLicenseUrl, periods);
}
@Override
protected DrmInitData.SchemeData parseContentProtection(XmlPullParser xpp) throws XmlPullParserException,
IOException {
...
} else if (XmlPullParserUtil.isStartTag(xpp, "ms:laurl")) {
drmLicenseUrl = xpp.getAttributeValue(null, "licenseUrl");
}
...
} Then you can use it with following steps below
public static AzureDashManifest loadManifest(DataSource dataSource, Uri uri)
throws IOException {
DataSpec dataSpec = new DataSpec(uri,
DataSpec.FLAG_ALLOW_CACHING_UNKNOWN_LENGTH | DataSpec.FLAG_ALLOW_GZIP);
ParsingLoadable<DashManifest> loadable = new ParsingLoadable<>(dataSource, dataSpec,
C.DATA_TYPE_MANIFEST, new AzureDashManifestParser());
loadable.load();
return (AzureDashManifest) loadable.getResult();
}
String drmLicenseUrl = manifest.drmLicenseUrl;
Map<String, String> keyRequestProperties = new HashMap<>();
keyRequestProperties.put("Authorization", String.format("Bearer=%s", token));
drmSessionManager = buildDrmSessionManager(drmLicenseUrl, keyRequestProperties);
// then initialize player with this drm session manager.
videoSource = new DashMediaSource(
manifest, new DefaultDashChunkSource.Factory(mediaDataSourceFactory), mainHandler, null
); |
@ojw28 |
@AquilesCanta - I think we probably need to add a It's somewhat unclear what preference should be given to that |
1 |
+1 |
Has anyone provided a sample manifest, as requested above? |
Also, you can get Authorization header by using our service api. This dash source is the one of samples in my service. So it does not require any permission. Manifest urlDRM optional header token Request urlPOST https://educast.com/api/v1/video/80/create_drm_token Request body example{
"drm_type" : 1
} Response example{
"token":"urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=2737157b-0c18-4c14-a320-3ab9f2870986&Audience=urn%3aeducast%3ausers&ExpiresOn=1518515102&Issuer=https%3a%2f%2feducast.pro&HMACSHA256=b5uMd%2fsgXlAMm3YctOL9k50xE3bHbV6hTeQygbcieD8%3d",
"expiration_time":"2018-02-13T18:45:02.810084"
} Usage example - Put token into HttpDrmCallback Header.// codes from our android application
HashMap<String, String> keyRequestProperties = new HashMap<>();
keyRequestProperties.put("Authorization", String.format("Bearer=%s", drmToken.token()));
for (String key : keyRequestProperties.keySet()) {
httpMediaDrmCallback.setKeyRequestProperty(key, keyRequestProperties.get(key));
}
return DefaultDrmSessionManager.newWidevineInstance(httpMediaDrmCallback, keyRequestProperties, handler, null); |
Allows DrmInitData to carry a license server URL when the media declares one. Issue:#3393 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199643743
@ojw28 I read commit's changes, however, I can't find anything to parse license server url from manifest (e.g. ms:pro(Azure Media Services's Widevine license url label)). Is it still developing? |
We haven't implemented the parsing part yet. The manifest urls above seem to have expired, can we get a new one? Aside, it would be great to have some kind of specification for the license server url tags, if possible. Can you provide any of them? Thanks. |
Note that at this point, the only required action is to populate the SchemeData in the manifest parser. You can override parseContentProtection and the DrmSessionManager should just pick it up. |
But this locator url can be changed soon. So, I attached the content of manifest and brief summary for microsoft's xml tag Manifest(format=mpd-time-csf).zip It contains license url like So, |
Even while using a token I am getting a 401 for the key requests using the provided token:
Can you help with this? Can you notice anything wrong with the format of the property? The manifest url is the last one:
|
Did you get token from
Thank you!! |
Issue:#3393 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201694813
I believe this is now fully implemented. @AquilesCanta - Can we close it? Thanks! |
Yes, apologies for not doing it before. @KiminRyu, please try it out and let us know if you run into any issues. |
Allows DrmInitData to carry a license server URL when the media declares one. Issue:#3393 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199643743
Issue:#3393 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201694813
I'm trying to play a DASH video with Widevine DRM provided by Azure.
In the manifest, inside the ContentProtection node, I receive: <ms:laurl licenseUrl="XXXXXX" />, but DashManifestParser doesn't parse that node. I'd prefer avoiding to download and parse the video manifest to get the licenseUrl, is there another way to achieve this?
The text was updated successfully, but these errors were encountered: