Post not yet marked as solved
When playing several short HLS clips using AVPlayer connected to a TV using Apple's Lightning-to-HDMI adapter (A1438) we often fail with those unknown errors.
CoreMediaErrorDomain -12034
and
CoreMediaErrorDomain -12158
Anyone has any clue what the errors mean?
Environment:
iPhone8
iOS 15.4
Lightning-to-HDMI adapter (A1438)
Post not yet marked as solved
Hi,I have some questions about how AVPlayer handles updates of a cookie's expiration time.We do something like this:1) Send a GET request to server which sets authentication cookie. This cookie has a short expiration time, CookieExpiryTime.2) Start AVPlayer. The authentication cookie is included in the AES key request.3) Every n minutes (where n is CookieExpiryTime/2), send new GET request to authentication server to get updated cookie expiration time. By logging all cookies in NSHTTPCookieStorage.sharedHTTPCookieStorage() we can see that the expiration time of the cookie is updated.The problem:When a key is requested after the expiration time of the first cookie from 1), the cookie is no longer included in the AES key request.But shouldn't the updated cookie (with extended expiration time) be considered?Question 1) Does AVPlayer filter out expired cookies when doing the AES key requests?Question 2) Does AVPlayer check NSHTTPCookieStorage.sharedHTTPCookieStorage() for updated cookies after init?Thanks,Anders
Post not yet marked as solved
We are using an ASWebAuthenticationSession to authenticate using an already logged in session in Safari.
This works fine on real hardware.
In Simulator from iOS13.5, the callback URL is always missing the session ID which indicates that ASWebAuthenticationSession couldn't access the cookies.
We are not using session cookies.
As documented here: https://developer.apple.com/documentation/authenticationservices/authenticating_a_user_through_a_web_service
Does anyone have any suggestion how to debug this and figure out if the problem is on our side or iOS side?
Post not yet marked as solved
Hi,Our use case is linear TV streaming.We've been using AVPlayerItem's preferredPeakBitrate to limit the max bitrate for our bandwidth concious users.Our code does it in this order:var playerItem = AVPlayerItem(asset: asset)
playerItem.preferredPeakBitrate = x
var player = AVPlayer()
player.replaceCurrentItem(with: playerItem)This has been working fine.Recently we got a report from a user on iOS13 claiming that his peak bitrate wasn't respected. We were able to confirm the report.Seems like the preferredPeakBitrate value is ignored unless we set it after the AVPlayerItem has reached .readyToPlay.Our experience from iOS12 and earlier is that the above code is fine.Has anyone else noticed this?
Post not yet marked as solved
An iOS app is playing using AVFoundation.
The master playlist of the content contains redundant media playlists.
Is there an API the app can use to switch/enable/disable between the redundant playlists?
Post not yet marked as solved
Hi,I've been trying to introduce usage of AVAssetDownloadStorageManager.setStorageManagementPolicy().For some reason the value I set has no effect.I set the new policy in the didFinishDownloadingTo delegate method like below, but when I immediately read it back the value hasn't changed.Reading it again on re-launch of the app, the value has also not been changed.Any advice on what I'm doing wrong is appreciated. func urlSession(_ session: URLSession, assetDownloadTask: AVAssetDownloadTask, didFinishDownloadingTo location: URL) {
guard let delegate = self.delegates.object(forKey: FileCodeKey(assetDownloadTask.fileCode)) else { return }
if #available(iOS 11, *) {
// Set the storage policy for the downloaded content
let storageManager = AVAssetDownloadStorageManager.shared()
let newPolicy = AVMutableAssetDownloadStorageManagementPolicy()
newPolicy.priority = .important
newPolicy.expirationDate = Date(timeIntervalSinceNow: 60 * 60 * 24 * 365)
storageManager.setStorageManagementPolicy(newPolicy, for: location)
if let policy = storageManager.storageManagementPolicy(for: location) {
print("After policy.priority: \(policy.priority)")
print("policy.expirationDate: \(policy.expirationDate)")
}
}Regards,Anders
Post not yet marked as solved
Hi,I noticed that HLS using "EXT-X-KEY:METHOD=SAMPLE-AES" the video content is excluded from screenshots.With method "AES-128" the video content is not excluded.I was expecting that only FairPlay would have screenshot blocking.Does anyone know if this is the expected behavior?Thanks,Anders
Note: The below is for iOS 10.3.3. On iOS11.4.1 all is confirmed to work.I'm downloading HLS+FP content by using an AVAssetDownloadTask created by calling AVAssetDownloadURLSession.makeAssetDownloadTask(asset:assetTitle:assetArtworkData:options).I set a japanese string as the assetTitle. (don't seem to be able to post Japanese text here... )The task is created, i call task.resume() but there is no progress.The task is created as I can find it with AVAssetDownloadURLSession.getAllTasks()The state of the task is running.But, there is no progress on the download.Using the exact same code but I instead set assetTitle to "Roasting landscape" makes the download progress and complete.assetTitle is documented as:> A human readable title for this asset in the user's preferred language. This value will be displayed in the usage pane of the Settings app.But the language of the string seems to impact if download works.Does anyone have experience to share ?
Hi,I looked in to how our packaging team is invoking mediafilesegmenter and noticed that -S is specified but that the ouput is file based encryption.The command line used:mediafilesegmenter -b http://URL -B abc- -i abc.m3u8 -S -J sequence -K http://hls/abc/ -n abc -t 11 -iframe-index-file none -start-segments-with-iframe abc.mp4Why does this output segments with file based encryption and not sample based encryption?