We are trying to implement a feature using google DAI with DRM(Fairplay) on iOS.
We have setup an asset with DRM stream, using SAMPLE-AES to encrypt the streams,
The m3u8 looks like:
#EXTM3U
#EXT-X-VERSION:5
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:248572
#EXT-X-DISCONTINUITY-SEQUENCE:22
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://2BA10A268D805ED1FB9047D18342592F",IV=0x2BA10A268D805ED1FB9047D18342592F,KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1"
#EXT-X-CUE-IN
#EXTINF:6.000000,
#EXT-X-PROGRAM-DATE-TIME:2023-01-06T03:41:33.059Z
#EXTINF:6.000000,
When trying to play it with the latest google ads ima sdk, we got an error says
"The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1002 - unsupported URL”.
Main codes as below:
// Create an ad display container for ad rendering.
let adDisplayContainer = IMAAdDisplayContainer(adContainer: videoView, viewController: self, companionSlots: nil)
// Create an IMAAVPlayerVideoDisplay to give the SDK access to your video player.
let imaVideoDisplay = IMAAVPlayerVideoDisplay(avPlayer: avPlayer)
// Create a stream request. Use one of "Live stream request" or "VOD request".
// Live stream request.
let request = IMALiveStreamRequest(assetKey: Constants.assetKey, adDisplayContainer: adDisplayContainer, videoDisplay: imaVideoDisplay)
self.adsLoader.requestStream(with: request)
We do have a license server for the client to get the data to decrypt the streams when the player trying to load the url asset with prefix ’skd://', but we can’t find a way to set the license server url to the ima sdk, or something else to make this.
We have tried `IMAAVPlayerVideoDisplayDelegate`, but this is just an async callback, it can not block the original asset loading request, so we can not get the data from our license server and pass it to the resource loader.
So for this case, how can I do to implement this feature with google ima sdk? Any help is appreciated.
Thanks,