setDrmConfig method

Future<void> setDrmConfig({
  1. required String videoUrl,
  2. required String licenseUrl,
  3. String? signingKey,
  4. String? edgeName,
  5. String? token,
  6. String? kid,
  7. double? width,
  8. double? height,
  9. String? alignment,
})

Implementation

Future<void> setDrmConfig({
  required String videoUrl,
  required String licenseUrl,
  String? signingKey,
  String? edgeName,
  String? token,
  String? kid,
  double? width,
  double? height,
  String? alignment,
}) async {
  try {
    _activeController = this;

    if (!_handlerInitialized) {
      _channel.setMethodCallHandler(_handleNativeMethodCall);
      _handlerInitialized = true;
    }

    await _channel.invokeMethod('setDrmConfig', {
      'videoUrl': videoUrl,
      'licenseUrl': licenseUrl,
      'signingKey': signingKey,
      'edgeName': edgeName,
      'token': token,
      'kid': kid,
      'width': width,
      'height': height,
      'alignment': alignment,
    });
  } catch (e) {
    _onError?.call('Failed to set DRM config: $e');
  }
}