金三角 v1.2.0版本的 MD5 值为:6a5bce6c149ec5f5f67d04c823d5cdcf
以下内容为反编译后的 SmoothStreamingTestMediaDrmCallback.java 源代码,内容仅作参考
package tv.danmaku.ijk.media.exo.demo;
import android.annotation.TargetApi;
import android.text.TextUtils;
import com.google.android.exoplayer.drm.ExoMediaDrm;
import com.google.android.exoplayer.drm.MediaDrmCallback;
import com.google.android.exoplayer.util.Util;
import com.lzy.okgo.model.HttpHeaders;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@TargetApi(18)
public class SmoothStreamingTestMediaDrmCallback implements MediaDrmCallback {
private static final Map<String, String> KEY_REQUEST_PROPERTIES;
private static final String PLAYREADY_TEST_DEFAULT_URI = "http://playready.directtaps.net/pr/svc/rightsmanager.asmx";
private static final Map<String, String> PROVISIONING_REQUEST_PROPERTIES = Collections.singletonMap(HttpHeaders.HEAD_KEY_CONTENT_TYPE, "application/octet-stream");
static {
HashMap hashMap = new HashMap();
hashMap.put(HttpHeaders.HEAD_KEY_CONTENT_TYPE, "text/xml");
hashMap.put("SOAPAction", "http://schemas.microsoft.com/DRM/2007/03/protocols/AcquireLicense");
KEY_REQUEST_PROPERTIES = hashMap;
}
public byte[] executeKeyRequest(UUID uuid, ExoMediaDrm.KeyRequest keyRequest) {
String defaultUrl = keyRequest.getDefaultUrl();
if (TextUtils.isEmpty(defaultUrl)) {
defaultUrl = PLAYREADY_TEST_DEFAULT_URI;
}
return Util.executePost(defaultUrl, keyRequest.getData(), KEY_REQUEST_PROPERTIES);
}
public byte[] executeProvisionRequest(UUID uuid, ExoMediaDrm.ProvisionRequest provisionRequest) {
return Util.executePost(provisionRequest.getDefaultUrl() + "&signedRequest=" + new String(provisionRequest.getData()), (byte[]) null, PROVISIONING_REQUEST_PROPERTIES);
}
}