How to instantiate a MediaDrm object

2019-08-26 22:17发布

问题:

I am using Nexus4 with Android 4.3, and I am try to use the new API public MediaDrm (UUID uuid), but I only can got the following exception:UnsupportedSchemeException.

The exception looks which arise from UUID is incorrect.

I've tried to use the UUID which is converted from deviceId, from network MAC address or from token which is sent from DRM server. all of I mentioned is incorrect.

Then is there anyone knows what is the correct way to get this UUID?

More info are in below:

Parameters:

uuid 

The UUID of the crypto scheme.

Thanks in advance.

回答1:

The UUID is a plugin identifiler, so please contact sansung.

The snip code as bellow comes from MediaDrmMockTest.java(try to use mock plugin)

static final UUID mockScheme = new UUID(0x0102030405060708L, 0x090a0b0c0d0e0f10L);


回答2:

This UUID parameter depends on which DRM scheme you would like to use. Each MediaDRM plugin defines its own UUID. If you take a look at the Mock DRM example, it is using 0102030405060708090a0b0c0d0e0f10