FairPlay Streaming

RSS for tag

Securely deliver streaming media to devices through the HTTP Live Streaming protocol using FairPlay Streaming (FPS).

Posts under FairPlay Streaming tag

200 Posts

Post

Replies

Boosts

Views

Activity

I cannot apply for a FPS certificate
I filled out the FPS certificate application form for existing applications twice in https://developer.apple.com/contact/fps/. After successful submission, I will say that I need to receive email in my mailbox, but I have not received the corresponding notification email in my mailbox. How do I deal with it? thank you!
1
0
984
May ’23
Native HLS streaming w/ Fairplay fails in Safari iOS 16+ but works in Safari iOS 15.6.1 at least
Streaming a FairPlay DRM protected video stream does not work in Safari iOS since iOS 16+. It was working correctly at least in Safari under iOS 15.6.1. (Note: it works correctly in Safari MacOS) I was able to reproduce the problem with 2 test pages of HLS FairPlay content in iOS Safari : JW player test page : https://developer-tools.jwplayer.com/stream-tester Shaka Player test page : https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;panel=CUSTOM%20CONTENT;build=uncompiled Can you please confirm that it is broken ? Thanks !
2
0
2.5k
Apr ’23
HLS+Fairplay stream resources freeing issue
The Context I'm using the HTML video element to play HLS+Fairplay streams (VOD and live) in Safari. My application is a Netflix-like. You can watch a video, stop, and watch another one. Concretly, the <video> tag is created upon each play and destroyed when the player exits. The Problem Sometimes, after exiting the player, launching a new video causes a MEDIA_ERR_DECODE error without anymore explanation. I can trace in my code that the Fairplay certificate and the CKC have been correctly retrieved and that the media session has been created and updated (with the CKC). In fact, when I log everything, I see the exact same logs as when it works. Except the final MEDIA_ERR_DECODE error. When I get this error, if I immediately retry to play, the same error happens, but if I wait about 5~10 seconds, it successfully plays. It's like some resource is waiting to be garbage-collected. What I tried I tried playing non-DRMed videos and it works perfectly: I could play, stop, play, etc. without any issue. So my guess is something is happening at the EME level. I've browsed the whole Internet (twice) and couldn't come up with a clear explanation. Most of the hints I found couldn't explain my issue (e.g. bad DRM-encryption, but how could it work the first time?) or solve it (e.g. videoElement.src = ""). I'm throwing a bottle into the sea, here... Thanks for your help!
2
0
2.1k
Apr ’23
FairPlay Content Packaging Using mediafilesegmenter tool
New to FairPlay implementation. Following Apple's "FairPlay Streaming Programming Guide", to transcoded & encrypted a MP4 file using command - mediafilesegmenter --stream-encrypt --streaming-key-delivery --encrypt-key-file=./key_iv.bin --encrypt-key-url="skd://example/key" ./input-content.mp4 key_iv.bin is the file which contains Encryption Key and Initialisation Vector. It is generating HLS's playlist, index and segment files. To test the encryption and the decryption precess, I am taking one segment file(which is generated by mediafilesegmenter, say fileSequence125.ts) and trying to decrypt(algorithm is "AES/CBC/NOPADDING") it using the same Encryption Key and Initialisation Vector, then I am getting bellow errors - Input length not multiple of 16 bytes So, does it means the length/size of each segment(.ts) file, which is generated by the mediafilesegmenter, should be a multiple of 16 bytes?
0
0
819
Apr ’23
FairPlay on iOS 16.1 and onward: AVAssetResourceLoaderDelegate not called with offline DRMs anymore
Hello, We are experiencing a new regression with iOS 16.1/16.2 beta when trying to play a video with offline FairPlay DRMs. Everything was working fine with 16.0.3 and below. The delegate public func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool is never called when you start playing an offline video. It prevents the player to get the DRM and we end up with a timeout CoreMediaError -19512. We tried to preload the existing keys asset.resourceLoader.preloadsEligibleContentKeys = true to no avail. We also looked at the solutions provided in this thread iOS 16 FairPlay Changes which was very similar to our issue but nothing worked for us (we are already using keyRequest.processContentKeyResponse(response)). The DRMs are valid and can be loaded if we move the key to an older iOS device (iOS 16 and below). However, we can see in the logs the following error happening before the CoreMediaError -19512. <<< FigPKDKeyManager >>>> PKDKeyManagerSetKeyRequestError: keyManager: 0x606ce 210 KeyID: F017D7B0-390-45ED-803-01A748DFB7A1 errOr: Error Domain-CoreMediaErrorDomain Code=-19160 " (null)" err: 0 The player just seem not to trigger any delegate starting 16.1+. Is anybody else experiencing the same issue? How can we find out why the delegate aren't triggered? Bests
2
1
2.4k
Mar ’23
[iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I'm trying to download HLS assets using AVAggregateAssetDownloadTask. It's pretty stable on iOS < 16.0. But after updating to iOS 16 I'm getting randomly following error: Task <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3> finished with error [-12640] Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(     "BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>" ), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>} Few retry attempts usually solve the issue. I have compared requests made by the app using proxy server and .m3u8 playlist does not differ between successful and failed download attempts. This is the network traffic when download fails. It stops on ...Audio_Selector.m3u8 playlist. And this is the network traffic when download successfully continues: Thanks!
4
3
2.8k
Feb ’23
App for FILMS AND TV
I need help with these question from apple. Does your app offer any paid service? Who are the users that will use the paid services in the app? Where can users purchase the services that can be accessed in the app? What specific types of previously purchased services can a user access in the app? What paid content, subscriptions, or features are unlocked within your app that do not use in-app purchase?
0
0
565
Feb ’23
AVFoundation to persist playlist , downloads two different video tracks.
Hi, I'm trying to download hls playlist video track by parsing specific bitrate / resolution. Downloads work perfectly fine. But we need to download specific video track variant from the manifest. So I parse bitrate & resolution via AVAssetDownloadTaskMinimumRequiredMediaBitrateKey & AVAssetDownloadTaskMinimumRequiredPresentationSizeKey. But AVAggregateAssetDownloadTask always downloads the specific ( parsed ) bitrate variant of the video track segments along with the lower resolution video track segments. This makes the download size to go higher than expected. Is this the expected behaviour or am I doing something wrong ? I tried the sample source from https://developer.apple.com/documentation/avfoundation/offline_playback_and_storage/using_avfoundation_to_play_and_persist_http_live_streams & it has the same behaviour. This is how my manifest file looks like. #EXT-X-VERSION:7 ## Created with Unified Streaming Platform (version=1.11.3-24483) #EXT-X-SESSION-KEY:METHOD=SAMPLE-AES,URI="skd://xxxxxxx",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1" # AUDIO groups #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-96",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=96000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-160",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=160000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-ec-3-192",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_1=192000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-320",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_2=320000.m3u8" # SUBTITLES groups #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="da",NAME="Dansk",DEFAULT=YES,AUTOSELECT=YES,URI="vod-idx-textstream_dan=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="fi",NAME="Suomi",AUTOSELECT=YES,URI="vod-idx-textstream_fin=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="no",NAME="Norsk",AUTOSELECT=YES,URI="vod-idx-textstream_nor=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="sv",NAME="Svenska",AUTOSELECT=YES,URI="vod-idx-textstream_swe=1000.m3u8" # variants #EXT-X-STREAM-INF:BANDWIDTH=416000,CODECS="mp4a.40.2,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-96",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=799000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-160",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1385000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2021000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3505000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5837000,CODECS="mp4a.40.2,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=513000,CODECS="ec-3,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=831000,CODECS="ec-3,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1255000,CODECS="ec-3,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1891000,CODECS="ec-3,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3375000,CODECS="ec-3,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5707000,CODECS="ec-3,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 # variants #EXT-X-STREAM-INF:BANDWIDTH=98000,CODECS="mp4a.40.2",AUDIO="audio-aacl-96",SUBTITLES="textstream" vod-idx-audio_eng=96000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=163000,CODECS="mp4a.40.2",AUDIO="audio-aacl-160",SUBTITLES="textstream" vod-idx-audio_eng=160000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=325000,CODECS="mp4a.40.2",AUDIO="audio-aacl-320",SUBTITLES="textstream" vod-idx-audio_eng_2=320000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=195000,CODECS="ec-3",AUDIO="audio-ec-3-192",SUBTITLES="textstream" vod-idx-audio_eng_1=192000.m3u8 # keyframes #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=40000,CODECS="avc1.4D4015",RESOLUTION=480x270,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=300000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=80000,CODECS="avc1.4D401E",RESOLUTION=640x360,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=133000,CODECS="avc1.4D401E",RESOLUTION=768x432,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=212000,CODECS="avc1.4D401F",RESOLUTION=960x540,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=398000,CODECS="avc1.64001F",RESOLUTION=1280x720,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=3000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=689000,CODECS="avc1.640032",RESOLUTION=1920x1080,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=5200000.m3u8" And this is how I create the download task let preferredMediaSelection = asset.urlAsset.preferredMediaSelection if #available(iOS 14.0, *) {       guard let task =           assetDownloadURLSession.aggregateAssetDownloadTask(with: asset.urlAsset,                                     mediaSelections: [preferredMediaSelection],                                     assetTitle: asset.stream.name,                                     assetArtworkData: nil,                                     options:                                     [AVAssetDownloadTaskMinimumRequiredMediaBitrateKey:5200000, AVAssetDownloadTaskMinimumRequiredPresentationSizeKey: CGSize(width: 1920, height: 1080)])       else { return }       task.taskDescription = asset.stream.name       task.resume()     } Any help will be appreciated. thanks
1
0
1.4k
Feb ’23
AVURLAsset with custom request header
Hi, Can we use AVURLAssetHTTPHeaderFieldsKey as options on AVURLAsset init? It is mentioned that since this is private key, app might get rejected. Is there any Apple official way to have custom header key for each m3u8 file while creating AVURLAsset for LIVE stream? Ref: https://stackoverflow.com/questions/60116789/is-it-possible-to-configure-custom-headers-for-avplayeritem-urlrequest Thank you in advance!
0
0
1.6k
Jan ’23
Error Downloading FairPlay content using AVAggregateDownloadTask
During intermittent download attempts or deleting the existing download and retrying itm getting the following error: The operation couldn’t be completed. (CoreMediaErrorDomain error -12640.) Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(\n    "BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>"\n), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>} The method which throws the error: func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) While downloading the content we prefetch the persistent key using AVContentKeySession and save that locally. Once we got the key successfully we start the download using AVAggregateDownloadTask. Hence we are not getting any issue in obtaining key or with the key exipry. Issue comes only at download attempt of that content. Background History of the issue: This issue is a follow up of a previous major issue, which we understood is an encoding issue for fairplay content. The issue was occuring on downloading of the highest resolution of the content either if we select or let the aggregate task pick the hgihest by default on its own. We used to get the following error code in response of download attempt which always fails: (CoreMediaErrorDomain error -12660 - HTTP 403: Forbidden) Note: We have also managed session our streams to upto 1 minute if the attempt to play same link it will result in failure to access stream. We fixed the issue by reducing the hls file size from backend encoding. Now we are getting this follow up issue afterwards. The problem is we are not able to get much information about the error code anywhere on the internet or documentation and not much help on forums as well. Generally people are getting this error at the time of key retrieval process. But we are getting via AVContentKeySession properly beforehand here and error coming only on download attempt of the content intermittently.
0
2
1.6k
Dec ’22
AVPlayer Not Able to Handle Relative Path URL in HLS Streams
We are running into an issue that seems unique to AVPlayer. We've built a new architecture for our HLS streams which makes use of relative URLs. We can play these channels on a number of other players just fine, but when trying to build using AVPlayer, the channel gets 400 errors requesting either child manifests/segments with relative URLs. Using curl, we are able to get a 200 success by getting to a url like: something.com/segmentfolder/../../abcd1234/videosegment_01.mp4 Curl is smart enough to get rid of the ../../ and create a valid path so the actual request (which can be seen using curl -v) looks something like: something.com/abcd1234/videosegment_01.mp4 Great. But AVPlayer doesn't do this. So it makes the request as is, which leads to a 400 error and it can't download the segment. We were able to simulate this problem with Swift playground fairly easily with this code: let hlsurl = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! print(hlsurl) print(hlsurl.standardized) The first print shows the URL as is. Trying to GET that URL leads to a 400. The second print properly handles it by adding .standardized to the URL. This leads to a 200. The problem is, this only works for the top level/initial manifest, it doesn't work for all the child manifests and segments. let url = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! let task = URLSession.shared.dataTask(with: url.standardized) {(data, response, error) in guard let data = data else { return } print(String(data: data, encoding: .utf8)!) } So question, does AVPlayer support relative URLs? If so, why can't it handle the ../../ in the URL path like other players and curl can? Is there a special way to get it to trigger standardizing ALL URL requests? Any help would be appreciated. n the network log.n the network log.
0
1
1.6k
Dec ’22
VTT Special Characters not displaying properly sometimes
When choosing to display a foreign audio track on some videos, the text does not render correctly. instead of a musical note I see white boxes for instance. This issue does not occur for the same content on Safari for Mac or Safari for iPad. The issue does present itself for a native mobile app (AVPlayer) on the same iPad, Safari for iPhone and the native mobile app on iPhone. Below is an image of the issue, the left is what I see on a problematic device and the right is what I would expect. Are there any known issues or workaround for this?
0
0
1.5k
Dec ’22
iOS 16 HLS Fairplay HDMI casting regression
Hi, as stated in this radar https://feedbackassistant.apple.com/feedback/11601970, our customers are facing issues after having upgraded to iOS 16 casting video from our app to their TV using HDMI Adaptor. HDMI casting is ok using clear (non Fairplay) video content but not with HLS Fairplay. The sound is broken and playback freezes a lot. The same problem happens on iOS 16 beta 1 as well. As far as I've seen there is no AVFoundation API update for iOS 16 listed in the release note. Anyone else experiencing this issue ? Best regards Cédric
4
2
2.2k
Dec ’22
I cannot apply for a FPS certificate
I filled out the FPS certificate application form for existing applications twice in https://developer.apple.com/contact/fps/. After successful submission, I will say that I need to receive email in my mailbox, but I have not received the corresponding notification email in my mailbox. How do I deal with it? thank you!
Replies
1
Boosts
0
Views
984
Activity
May ’23
Native HLS streaming w/ Fairplay fails in Safari iOS 16+ but works in Safari iOS 15.6.1 at least
Streaming a FairPlay DRM protected video stream does not work in Safari iOS since iOS 16+. It was working correctly at least in Safari under iOS 15.6.1. (Note: it works correctly in Safari MacOS) I was able to reproduce the problem with 2 test pages of HLS FairPlay content in iOS Safari : JW player test page : https://developer-tools.jwplayer.com/stream-tester Shaka Player test page : https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;panel=CUSTOM%20CONTENT;build=uncompiled Can you please confirm that it is broken ? Thanks !
Replies
2
Boosts
0
Views
2.5k
Activity
Apr ’23
HLS+Fairplay stream resources freeing issue
The Context I'm using the HTML video element to play HLS+Fairplay streams (VOD and live) in Safari. My application is a Netflix-like. You can watch a video, stop, and watch another one. Concretly, the <video> tag is created upon each play and destroyed when the player exits. The Problem Sometimes, after exiting the player, launching a new video causes a MEDIA_ERR_DECODE error without anymore explanation. I can trace in my code that the Fairplay certificate and the CKC have been correctly retrieved and that the media session has been created and updated (with the CKC). In fact, when I log everything, I see the exact same logs as when it works. Except the final MEDIA_ERR_DECODE error. When I get this error, if I immediately retry to play, the same error happens, but if I wait about 5~10 seconds, it successfully plays. It's like some resource is waiting to be garbage-collected. What I tried I tried playing non-DRMed videos and it works perfectly: I could play, stop, play, etc. without any issue. So my guess is something is happening at the EME level. I've browsed the whole Internet (twice) and couldn't come up with a clear explanation. Most of the hints I found couldn't explain my issue (e.g. bad DRM-encryption, but how could it work the first time?) or solve it (e.g. videoElement.src = ""). I'm throwing a bottle into the sea, here... Thanks for your help!
Replies
2
Boosts
0
Views
2.1k
Activity
Apr ’23
Do FairPlay and AVPlayer support Clear Lead?
In DRM-protected files, usually there's a Clear Lead -- the first few seconds are clear. It allows playback to start without having to wait for license response, improving video start time (and user experience).The question is, therefore: if a stream has clear lead, will AVPlayer start playing without waiting for response from the DRM server?
Replies
12
Boosts
0
Views
6.5k
Activity
Apr ’23
FairPlay Content Packaging Using mediafilesegmenter tool
New to FairPlay implementation. Following Apple's "FairPlay Streaming Programming Guide", to transcoded & encrypted a MP4 file using command - mediafilesegmenter --stream-encrypt --streaming-key-delivery --encrypt-key-file=./key_iv.bin --encrypt-key-url="skd://example/key" ./input-content.mp4 key_iv.bin is the file which contains Encryption Key and Initialisation Vector. It is generating HLS's playlist, index and segment files. To test the encryption and the decryption precess, I am taking one segment file(which is generated by mediafilesegmenter, say fileSequence125.ts) and trying to decrypt(algorithm is "AES/CBC/NOPADDING") it using the same Encryption Key and Initialisation Vector, then I am getting bellow errors - Input length not multiple of 16 bytes So, does it means the length/size of each segment(.ts) file, which is generated by the mediafilesegmenter, should be a multiple of 16 bytes?
Replies
0
Boosts
0
Views
819
Activity
Apr ’23
How do I access a FairPlay protected stream's frame in avplayer?
when i played a fairplay streaming by avplayer,calling copyPixelBufferForItemTime on AVPlayerItemVideoOutput the pixelbuffer returns NULL.is there any way to get the pixel buffer from a stream that is protected using FairPlay on iOS or apple's APIs in order to display FairPlay stream on an OpenGL texture in 3D space?
Replies
1
Boosts
0
Views
719
Activity
Mar ’23
FairPlay on iOS 16.1 and onward: AVAssetResourceLoaderDelegate not called with offline DRMs anymore
Hello, We are experiencing a new regression with iOS 16.1/16.2 beta when trying to play a video with offline FairPlay DRMs. Everything was working fine with 16.0.3 and below. The delegate public func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool is never called when you start playing an offline video. It prevents the player to get the DRM and we end up with a timeout CoreMediaError -19512. We tried to preload the existing keys asset.resourceLoader.preloadsEligibleContentKeys = true to no avail. We also looked at the solutions provided in this thread iOS 16 FairPlay Changes which was very similar to our issue but nothing worked for us (we are already using keyRequest.processContentKeyResponse(response)). The DRMs are valid and can be loaded if we move the key to an older iOS device (iOS 16 and below). However, we can see in the logs the following error happening before the CoreMediaError -19512. <<< FigPKDKeyManager >>>> PKDKeyManagerSetKeyRequestError: keyManager: 0x606ce 210 KeyID: F017D7B0-390-45ED-803-01A748DFB7A1 errOr: Error Domain-CoreMediaErrorDomain Code=-19160 " (null)" err: 0 The player just seem not to trigger any delegate starting 16.1+. Is anybody else experiencing the same issue? How can we find out why the delegate aren't triggered? Bests
Replies
2
Boosts
1
Views
2.4k
Activity
Mar ’23
New FairPlay Streaming (FPS) credentials
Hi, I have a question about FairPlay Streaming (FPS) credentials. When a new set of FPS credentials is requested, will existing FPS Credentials on a live app continue to function until it is swapped for the new ones?  Or will the existing FPS credentials immediately cease to function upon issuing new FPS credentials?
Replies
0
Boosts
0
Views
714
Activity
Mar ’23
When is contentKeySession(_:shouldRetry:reason:) called?
This is a question about AVContentKeySessionDelegate. I want contentKeySession(_:didProvide:) to be called only once. I thought I could control this with contentKeySession(_:shouldRetry:reason:), but this method is not called. How can contentKeySession(_:shouldRetry:reason:) be called? I would be happy to share your knowledge with you.
Replies
0
Boosts
0
Views
632
Activity
Mar ’23
CoreMediaErrorDomain error -12971
Trying to play some non DRM video from HLS url but AVPlayer is not playing the video, Exactly getting this error :- "Player Item Error: Optional("The operation couldn’t be completed. (CoreMediaErrorDomain error -12971.)")" . No idea what is happening here and also what does error -12971 means exactly?
Replies
4
Boosts
0
Views
3.4k
Activity
Feb ’23
Fairplay Certificate is not trusted
Hi all, We have created the Fairplay Certificate, but now when we check it with keychain, we get the error certificate is not trusted can you help us, thank you
Replies
0
Boosts
0
Views
860
Activity
Feb ’23
[iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I'm trying to download HLS assets using AVAggregateAssetDownloadTask. It's pretty stable on iOS < 16.0. But after updating to iOS 16 I'm getting randomly following error: Task <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3> finished with error [-12640] Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(     "BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>" ), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>} Few retry attempts usually solve the issue. I have compared requests made by the app using proxy server and .m3u8 playlist does not differ between successful and failed download attempts. This is the network traffic when download fails. It stops on ...Audio_Selector.m3u8 playlist. And this is the network traffic when download successfully continues: Thanks!
Replies
4
Boosts
3
Views
2.8k
Activity
Feb ’23
App for FILMS AND TV
I need help with these question from apple. Does your app offer any paid service? Who are the users that will use the paid services in the app? Where can users purchase the services that can be accessed in the app? What specific types of previously purchased services can a user access in the app? What paid content, subscriptions, or features are unlocked within your app that do not use in-app purchase?
Replies
0
Boosts
0
Views
565
Activity
Feb ’23
AVFoundation to persist playlist , downloads two different video tracks.
Hi, I'm trying to download hls playlist video track by parsing specific bitrate / resolution. Downloads work perfectly fine. But we need to download specific video track variant from the manifest. So I parse bitrate & resolution via AVAssetDownloadTaskMinimumRequiredMediaBitrateKey & AVAssetDownloadTaskMinimumRequiredPresentationSizeKey. But AVAggregateAssetDownloadTask always downloads the specific ( parsed ) bitrate variant of the video track segments along with the lower resolution video track segments. This makes the download size to go higher than expected. Is this the expected behaviour or am I doing something wrong ? I tried the sample source from https://developer.apple.com/documentation/avfoundation/offline_playback_and_storage/using_avfoundation_to_play_and_persist_http_live_streams & it has the same behaviour. This is how my manifest file looks like. #EXT-X-VERSION:7 ## Created with Unified Streaming Platform (version=1.11.3-24483) #EXT-X-SESSION-KEY:METHOD=SAMPLE-AES,URI="skd://xxxxxxx",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1" # AUDIO groups #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-96",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=96000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-160",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=160000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-ec-3-192",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_1=192000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-320",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_2=320000.m3u8" # SUBTITLES groups #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="da",NAME="Dansk",DEFAULT=YES,AUTOSELECT=YES,URI="vod-idx-textstream_dan=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="fi",NAME="Suomi",AUTOSELECT=YES,URI="vod-idx-textstream_fin=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="no",NAME="Norsk",AUTOSELECT=YES,URI="vod-idx-textstream_nor=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="sv",NAME="Svenska",AUTOSELECT=YES,URI="vod-idx-textstream_swe=1000.m3u8" # variants #EXT-X-STREAM-INF:BANDWIDTH=416000,CODECS="mp4a.40.2,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-96",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=799000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-160",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1385000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2021000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3505000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5837000,CODECS="mp4a.40.2,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=513000,CODECS="ec-3,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=831000,CODECS="ec-3,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1255000,CODECS="ec-3,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1891000,CODECS="ec-3,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3375000,CODECS="ec-3,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5707000,CODECS="ec-3,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 # variants #EXT-X-STREAM-INF:BANDWIDTH=98000,CODECS="mp4a.40.2",AUDIO="audio-aacl-96",SUBTITLES="textstream" vod-idx-audio_eng=96000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=163000,CODECS="mp4a.40.2",AUDIO="audio-aacl-160",SUBTITLES="textstream" vod-idx-audio_eng=160000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=325000,CODECS="mp4a.40.2",AUDIO="audio-aacl-320",SUBTITLES="textstream" vod-idx-audio_eng_2=320000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=195000,CODECS="ec-3",AUDIO="audio-ec-3-192",SUBTITLES="textstream" vod-idx-audio_eng_1=192000.m3u8 # keyframes #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=40000,CODECS="avc1.4D4015",RESOLUTION=480x270,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=300000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=80000,CODECS="avc1.4D401E",RESOLUTION=640x360,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=133000,CODECS="avc1.4D401E",RESOLUTION=768x432,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=212000,CODECS="avc1.4D401F",RESOLUTION=960x540,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=398000,CODECS="avc1.64001F",RESOLUTION=1280x720,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=3000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=689000,CODECS="avc1.640032",RESOLUTION=1920x1080,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=5200000.m3u8" And this is how I create the download task let preferredMediaSelection = asset.urlAsset.preferredMediaSelection if #available(iOS 14.0, *) {       guard let task =           assetDownloadURLSession.aggregateAssetDownloadTask(with: asset.urlAsset,                                     mediaSelections: [preferredMediaSelection],                                     assetTitle: asset.stream.name,                                     assetArtworkData: nil,                                     options:                                     [AVAssetDownloadTaskMinimumRequiredMediaBitrateKey:5200000, AVAssetDownloadTaskMinimumRequiredPresentationSizeKey: CGSize(width: 1920, height: 1080)])       else { return }       task.taskDescription = asset.stream.name       task.resume()     } Any help will be appreciated. thanks
Replies
1
Boosts
0
Views
1.4k
Activity
Feb ’23
AVURLAsset with custom request header
Hi, Can we use AVURLAssetHTTPHeaderFieldsKey as options on AVURLAsset init? It is mentioned that since this is private key, app might get rejected. Is there any Apple official way to have custom header key for each m3u8 file while creating AVURLAsset for LIVE stream? Ref: https://stackoverflow.com/questions/60116789/is-it-possible-to-configure-custom-headers-for-avplayeritem-urlrequest Thank you in advance!
Replies
0
Boosts
0
Views
1.6k
Activity
Jan ’23
developer
When WKWebView uses getUserMedia, the following authorization prompt will pop up every time you exit the app (as shown below). How to solve this problem? thank you.(https://obs-ogt.obs.cn-east-3.myhuaweicloud.com:443/tinymce/1672364537956-%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20221230094106.png)
Replies
0
Boosts
0
Views
729
Activity
Dec ’22
Error Downloading FairPlay content using AVAggregateDownloadTask
During intermittent download attempts or deleting the existing download and retrying itm getting the following error: The operation couldn’t be completed. (CoreMediaErrorDomain error -12640.) Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(\n    "BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>"\n), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>} The method which throws the error: func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) While downloading the content we prefetch the persistent key using AVContentKeySession and save that locally. Once we got the key successfully we start the download using AVAggregateDownloadTask. Hence we are not getting any issue in obtaining key or with the key exipry. Issue comes only at download attempt of that content. Background History of the issue: This issue is a follow up of a previous major issue, which we understood is an encoding issue for fairplay content. The issue was occuring on downloading of the highest resolution of the content either if we select or let the aggregate task pick the hgihest by default on its own. We used to get the following error code in response of download attempt which always fails: (CoreMediaErrorDomain error -12660 - HTTP 403: Forbidden) Note: We have also managed session our streams to upto 1 minute if the attempt to play same link it will result in failure to access stream. We fixed the issue by reducing the hls file size from backend encoding. Now we are getting this follow up issue afterwards. The problem is we are not able to get much information about the error code anywhere on the internet or documentation and not much help on forums as well. Generally people are getting this error at the time of key retrieval process. But we are getting via AVContentKeySession properly beforehand here and error coming only on download attempt of the content intermittently.
Replies
0
Boosts
2
Views
1.6k
Activity
Dec ’22
AVPlayer Not Able to Handle Relative Path URL in HLS Streams
We are running into an issue that seems unique to AVPlayer. We've built a new architecture for our HLS streams which makes use of relative URLs. We can play these channels on a number of other players just fine, but when trying to build using AVPlayer, the channel gets 400 errors requesting either child manifests/segments with relative URLs. Using curl, we are able to get a 200 success by getting to a url like: something.com/segmentfolder/../../abcd1234/videosegment_01.mp4 Curl is smart enough to get rid of the ../../ and create a valid path so the actual request (which can be seen using curl -v) looks something like: something.com/abcd1234/videosegment_01.mp4 Great. But AVPlayer doesn't do this. So it makes the request as is, which leads to a 400 error and it can't download the segment. We were able to simulate this problem with Swift playground fairly easily with this code: let hlsurl = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! print(hlsurl) print(hlsurl.standardized) The first print shows the URL as is. Trying to GET that URL leads to a 400. The second print properly handles it by adding .standardized to the URL. This leads to a 200. The problem is, this only works for the top level/initial manifest, it doesn't work for all the child manifests and segments. let url = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! let task = URLSession.shared.dataTask(with: url.standardized) {(data, response, error) in guard let data = data else { return } print(String(data: data, encoding: .utf8)!) } So question, does AVPlayer support relative URLs? If so, why can't it handle the ../../ in the URL path like other players and curl can? Is there a special way to get it to trigger standardizing ALL URL requests? Any help would be appreciated. n the network log.n the network log.
Replies
0
Boosts
1
Views
1.6k
Activity
Dec ’22
VTT Special Characters not displaying properly sometimes
When choosing to display a foreign audio track on some videos, the text does not render correctly. instead of a musical note I see white boxes for instance. This issue does not occur for the same content on Safari for Mac or Safari for iPad. The issue does present itself for a native mobile app (AVPlayer) on the same iPad, Safari for iPhone and the native mobile app on iPhone. Below is an image of the issue, the left is what I see on a problematic device and the right is what I would expect. Are there any known issues or workaround for this?
Replies
0
Boosts
0
Views
1.5k
Activity
Dec ’22
iOS 16 HLS Fairplay HDMI casting regression
Hi, as stated in this radar https://feedbackassistant.apple.com/feedback/11601970, our customers are facing issues after having upgraded to iOS 16 casting video from our app to their TV using HDMI Adaptor. HDMI casting is ok using clear (non Fairplay) video content but not with HLS Fairplay. The sound is broken and playback freezes a lot. The same problem happens on iOS 16 beta 1 as well. As far as I've seen there is no AVFoundation API update for iOS 16 listed in the release note. Anyone else experiencing this issue ? Best regards Cédric
Replies
4
Boosts
2
Views
2.2k
Activity
Dec ’22