Hello,
I am not sure about the first error.
For the second error, in order to use FairPlay with CMAF (or to enable offline FairPlay too), you need to create and use a custom streaming policy. In that policy, you need to activate FairPlay with DASH (as CMAF used MP4 fragments). The CommonEncryptionCenc and CommonEncryptionCbcs objects can be created as below :
/// <summary>
/// Generates de Cenc config for Dash and Smooth Streaming.
/// </summary>
/// <returns>The Cenc configuration.</returns>
protected static CommonEncryptionCenc GenerateCencConfig()
{
return new CommonEncryptionCenc()
{
Drm = new CencDrmConfiguration()
{
PlayReady = new StreamingPolicyPlayReadyConfiguration(),
Widevine = new StreamingPolicyWidevineConfiguration()
},
EnabledProtocols = new EnabledProtocols()
{
Hls = false,
Dash = true,
SmoothStreaming = true,
Download = false
},
ContentKeys = new StreamingPolicyContentKeys()
{
// Default key must be specified if keyToTrackMappings is present
DefaultKey = new DefaultKey()
{
Label = "cencKeyDefault"
}
}
};
}
/// <summary>
/// Generates de Cbcs config with offline FairPlayfor HLS-Ts and HLS-Cmaf.
/// </summary>
/// <returns>The Cenc configuration.</returns>
protected static CommonEncryptionCbcs GenerateCbcsConfig()
{
return new CommonEncryptionCbcs()
{
Drm = new CbcsDrmConfiguration()
{
FairPlay = new StreamingPolicyFairPlayConfiguration()
{
AllowPersistentLicense = true // this enables offline mode
}
},
EnabledProtocols = new EnabledProtocols()
{
Hls = true,
Dash = true // Even though DASH under CBCS is not supported for either CSF or CMAF, HLS-CMAF-CBCS uses DASH-CBCS fragments in its HLS playlist
},
ContentKeys = new StreamingPolicyContentKeys()
{
// Default key must be specified if keyToTrackMappings is present
DefaultKey = new DefaultKey()
{
Label = "cbcsKeyDefault"
}
}
};
}