/// <summary> /// Adds an MPEG-CENC DRM configuration to the muxing to encrypt its output. Widevine and FairPlay /// specific fields will be included into DASH and HLS manifests to enable key retrieval using either /// DRM method.<para/> /// /// API endpoint: /// https://bitmovin.com/docs/encoding/api-reference/sections/encodings#/Encoding/PostEncodingEncodingsMuxingsFmp4DrmCencByEncodingIdAndMuxingId /// </summary> /// <param name="encoding">The encoding to which the muxing belongs to</param> /// <param name="muxing">The muxing to apply the encryption to</param> /// <param name="output">The output resource to which the encrypted segments will be written to</param> /// <param name="outputPath">The output path where the encrypted segments will be written to</param> private Task CreateDrmConfig(Models.Encoding encoding, Muxing muxing, Output output, string outputPath) { var widevineDrm = new CencWidevine() { Pssh = _configProvider.GetDrmWidevinePssh() }; var cencFairPlay = new CencFairPlay() { Iv = _configProvider.GetDrmFairplayIv(), Uri = _configProvider.GetDrmFairplayUri() }; var cencDrm = new CencDrm() { Outputs = new List <EncodingOutput>() { BuildEncodingOutput(output, outputPath) }, Key = _configProvider.GetDrmKey(), Kid = _configProvider.GetDrmWidevineKid(), Widevine = widevineDrm, FairPlay = cencFairPlay }; return(_bitmovinApi.Encoding.Encodings.Muxings.Fmp4.Drm.Cenc.CreateAsync(encoding.Id, muxing.Id, cencDrm)); }