Android exoplayer with drmtoday

826 Views Asked by At

I try to read video in exoplayer with drmtoday on Android app, but it's not working. I add all the parameters for key request properties but still does not work. Please help me to solve this issue.

I try this code :

  String uri = "https://origin.cdn.afrostream.net/vod/24hourlovebis/d4eed726882a4be3-drm.ism/.mpd";

            String extension = "mpd";
            String name="WV: HDCP not specified";
            UUID drmSchemeUuid= null;
            try {
               drmSchemeUuid = getDrmUuid("widevine");
               // drmSchemeUuid = getDrmUuid("");
            } catch (ParserException e) {
                e.printStackTrace();
            }


            String drmLicenseUrl="https://lic.staging.drmtoday.com/license-proxy-widevine/cenc/";
            //String drmLicenseUrl="http://lic.staging.drmtoday.com/license-proxy-widevine/";
            String[] drmKeyRequestProperties=null;

            ArrayList<String> drmKeyRequestPropertiesList = new ArrayList<>();
            JSONObject js=new JSONObject ();
            try {
                js.put("userId", "12345");
                js.put("sessionId", "12345");
                js.put("merchant", "afrostream");
            }catch ( Exception ee)
            {
                ee.printStackTrace();
            }
           drmKeyRequestPropertiesList.add("dt-custom-data");

           drmKeyRequestPropertiesList.add(js.toString());
           drmKeyRequestProperties = drmKeyRequestPropertiesList.toArray(new String[0]);



            Sample smp=new UriSample( name,  drmSchemeUuid,  drmLicenseUrl,      drmKeyRequestProperties,  false,uri,extension) ;
            Intent nb=smp.buildIntent(getApplicationContext());
            startActivity(nb);
1

There are 1 best solutions below

1
On

on a quick look seems that is missing the assetID and variantId info.