Play DRM Protected Videos on Native Android Player

I am developing an application based on drm player, I can get drm info, but I don’t know how to integrate drm into native android player for this I use

mVideoView = (VideoView) findViewById (R.id.Trailer_VV);

    String android_id = Secure.getString(getContentResolver(),Secure.ANDROID_ID);

    url = "https://s3-us-west-2.amazonaws.com/amgo/SECOND.wvm";

    System.out.println("Print android_id " + android_id);

    DrmInfoRequest request = new DrmInfoRequest(DrmInfoRequest. TYPE_REGISTRATION_INFO, "video/wvm");
    request.put("WVDRMServerKey", "http://widevine.ezdrm.com/widevine/cypherpc/cgi-bin/GetEMMs-ezdrm.cgi");
    request.put("WVAssetURIKey", "https://s3-us-west-2.amazonaws.com/amgo/SECOND.wvm");
    request.put("WVDeviceIDKey", "movidone");
    request.put("WVPortalKey", "movidone");
    request.put("WVCAUserDataKey", "ezE7B1D1");

    client = new DrmManagerClient(VideoViewActivity.this);
    client.acquireRights(request);

    DrmInfo response = client.acquireDrmInfo(request);

    if (response != null) {
        System.out.println("DrmInfo " + response.getMimeType().toString());
        //System.out.println("DrmInfo " + response.getData());
        String drmInfoReqStatusKey = (String)response.get("WVDrmInfoRequestStatusKey");
        if (null != drmInfoReqStatusKey && !drmInfoReqStatusKey.equals("")) {
            long mWVDrmInfoReqStatusKey = Long.parseLong(drmInfoReqStatusKey);
            System.out.println("mWVDrmInfoReqStatusKey: "+mWVDrmInfoReqStatusKey);
        }
        String mPluginVersion = (String)response.get("WVDrmInfoRequestVersionKey");

        System.out.println("mPluginVersion: "+mPluginVersion);

    } else {
        System.out.println("no result");
    }


    mVideoView.setVideoURI(Uri.parse(url));

    mVideoView.start(); 

      

+3


source to share





All Articles