Java Code Examples for android.media.MediaDrm#setPropertyString()

The following examples show how to use android.media.MediaDrm#setPropertyString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaDrmBridge.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private MediaDrmBridge(UUID schemeUUID, String securityLevel, int nativeMediaDrmBridge)
        throws android.media.UnsupportedSchemeException {
    mSchemeUUID = schemeUUID;
    mMediaDrm = new MediaDrm(schemeUUID);
    mHandler = new Handler();
    mNativeMediaDrmBridge = nativeMediaDrmBridge;
    mResetDeviceCredentialsPending = false;
    mMediaDrm.setOnEventListener(new MediaDrmListener());
    mMediaDrm.setPropertyString(PRIVACY_MODE, "enable");
    String currentSecurityLevel = mMediaDrm.getPropertyString(SECURITY_LEVEL);
    Log.e(TAG, "Security level: current " + currentSecurityLevel + ", new " + securityLevel);
    if (!securityLevel.equals(currentSecurityLevel))
        mMediaDrm.setPropertyString(SECURITY_LEVEL, securityLevel);
}
 
Example 2
Source File: MediaDrmBridge.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private MediaDrmBridge(UUID schemeUUID, String securityLevel, int nativeMediaDrmBridge)
        throws android.media.UnsupportedSchemeException {
    mSchemeUUID = schemeUUID;
    mMediaDrm = new MediaDrm(schemeUUID);
    mHandler = new Handler();
    mNativeMediaDrmBridge = nativeMediaDrmBridge;
    mResetDeviceCredentialsPending = false;
    mMediaDrm.setOnEventListener(new MediaDrmListener());
    mMediaDrm.setPropertyString(PRIVACY_MODE, "enable");
    String currentSecurityLevel = mMediaDrm.getPropertyString(SECURITY_LEVEL);
    Log.e(TAG, "Security level: current " + currentSecurityLevel + ", new " + securityLevel);
    if (!securityLevel.equals(currentSecurityLevel))
        mMediaDrm.setPropertyString(SECURITY_LEVEL, securityLevel);
}
 
Example 3
Source File: FrameworkMediaDrm.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@SuppressLint("WrongConstant") // Suppress spurious lint error [Internal ref: b/32137960]
private static void forceWidevineL3(MediaDrm mediaDrm) {
  mediaDrm.setPropertyString("securityLevel", "L3");
}
 
Example 4
Source File: FrameworkMediaDrm.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@SuppressLint("WrongConstant") // Suppress spurious lint error [Internal ref: b/32137960]
private static void forceWidevineL3(MediaDrm mediaDrm) {
  mediaDrm.setPropertyString("securityLevel", "L3");
}
 
Example 5
Source File: FrameworkMediaDrm.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@SuppressLint("WrongConstant") // Suppress spurious lint error [Internal ref: b/32137960]
private static void forceWidevineL3(MediaDrm mediaDrm) {
  mediaDrm.setPropertyString("securityLevel", "L3");
}