toSourceDescription function
Implementation
SourceDescription toSourceDescription(PlatformInterface.SourceDescription flutterSourceDescription) {
List<TypedSource> flutterTypedSources = [];
for (var flutterTypedSource in flutterSourceDescription.sources) {
if (flutterTypedSource == null) {
continue;
}
FairplayContentProtectionConfiguration? flutterFairplayDrmConfiguration;
PlatformInterface.FairPlayDRMConfiguration? fairplay = flutterTypedSource.drm?.fairplay;
if (fairplay != null) {
flutterFairplayDrmConfiguration = FairplayContentProtectionConfiguration(licenseAcquisitionURL: fairplay.licenseAcquisitionURL, certificateURL: fairplay.certificateURL);
}
WidevineContentProtectionConfiguration? flutterWidevineDrmConfiguration;
PlatformInterface.WidevineDRMConfiguration? widevine = flutterTypedSource.drm?.widevine;
if (widevine != null) {
flutterWidevineDrmConfiguration = WidevineContentProtectionConfiguration(licenseAcquisitionURL: widevine.licenseAcquisitionURL);
}
flutterTypedSources.add(TypedSource(integration: flutterTypedSource.integration?.name, src: flutterTypedSource.src, contentProtection: ContentProtection(fairplay: flutterFairplayDrmConfiguration, widevine: flutterWidevineDrmConfiguration)));
}
return SourceDescription(sources: flutterTypedSources);
}