Posts

Post not yet marked as solved
1 Replies
722 Views
We are using EZDRM for DRM protection. Online playback works fine on iOS 10-13, whereas offline playback works on iOS 11-13, but not iOS 10; persistent content key was introduced in iOS 10, so it should work. I have used EZDRM's sample project to test, which uses AVAssetResourceLoaderDelegate. After downloading the video and content key, when we tried to play the downloaded video, the following errors occurred. Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x17005d1c0 {Error Domain=NSOSStatusErrorDomain Code=-42651 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-42651), NSLocalizedDescription=The operation could not be completed} Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSUnderlyingError=0x17005be40 {Error Domain=NSOSStatusErrorDomain Code=-12882 "(null)"}, NSLocalizedFailureReason=An unknown error occurred (-12882), NSLocalizedDescription=The operation could not be completed} Logging the loading request object (from iOS 10): <AVAssetResourceLoadingRequest: 0x174201f10, URL request = <NSMutableURLRequest: 0x1702009a0> { URL: skd://fps.ezdrm.com/;xxxxxx }, request ID = 2, content information request = <AVAssetResourceLoadingContentInformationRequest: 0x174202060, content type = "(null)", content length = 0, byte range access supported = NO, disk caching permitted = NO, renewal date = (null)>, data request = <AVAssetResourceLoadingDataRequest: 0x174201de0, requested offset = 0, requested length = 9223372036854775807, requests all data to end of resource = YES, current offset = 0>> I found that: disk caching permitted = NO on iOS 10 disk caching permitted = YES on iOS 11-13 Not sure if it is the reason of failure, and don't know which part controls the value of this property. I have also used Apple's HLSCatalogWithFPS to test, which uses AVContentKeySession. Originally, its deployment target is iOS 11.3, I've modified a bit so that it can also run on iOS 10.3, e.g.: keyRequest.respondByRequestingPersistableContentKeyRequestAndReturnError() -> keyRequest.respondByRequestingPersistableContentKeyRequest() AVAggregateAssetDownloadTask -> AVAssetDownloadTask However, after calling respondByRequestingPersistableContentKeyRequest(), contentKeySession:didProvidePersistableContentKeyRequest: did not get called, instead contentKeySession:didProvideContentKeyRequest: was called, and it created an infinite loop here. According to the document https://developer.apple.com/documentation/avfoundation/avcontentkeyrequest/2799207-respondbyrequestingpersistableco : An NSInternalInconsistencyException is returned if your delegate does not respond to contentKeySession:didProvidePersistableContentKeyRequest:. So I tried to comment out that delegate method, but there was no exception at all; there was exception if it was running on iOS 11. It seems the whole FairPlay offline playback thing does not work on iOS 10. Can anyone help?
Posted
by c.leung.
Last updated
.
Post not yet marked as solved
0 Replies
1k Views
Our app's main feature is to provide online .m4a audio files to users to listen. Recently, there were many users complaining that they had encountered playback failure.Some of the errors were:- avPlayer.currentItem.error = Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot Complete Action" UserInfo={NSLocalizedDescription=Cannot Complete Action, NSLocalizedRecoverySuggestion=Try again later.}- avPlayer.currentItem.error = Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (352107053), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x281aade90 {Error Domain=NSOSStatusErrorDomain Code=352107053 "(null)"}}Apart from the error, they all received AVAudioSessionMediaServicesWereResetNotification.We found that it can be reproduced by using Network Link Conditioner and setting the Delay to around 400ms. In that case, after around 9-10s of loading, the player will throw the AVErrorMediaServicesWereReset error.Is it possible to set the timeout of the AVPlayer, or is there any other way to handle this problem?
Posted
by c.leung.
Last updated
.
Post not yet marked as solved
4 Replies
1.5k Views
Our app's main feature is to play a list of audio tracks (local or progressively downloaded file-based audio files).When a user selects a program, there will be an array of track objects (track id, description, url, etc). To start playback, we instantiate a new AVPlayer and set the track url to the player; when that track finishes (observe AVPlayerItemDidPlayToEndTimeNotification), we release the existing player, and then instantiate a new AVPlayer for the next track.We have set AVAudioSessionCategoryPlayback when app launches.We have set AVAudioSession active = YES when a new track is played.The implementation worked fine for many years. But starting from iOS 12.2, our users started experiencing some playback problems such as:1. Failed to play the next track automatically.-- from our logs, we can see that the player has started loading the next track, but then it was stopped (KVO, rate = 0)2. The controls in Control Center were missing; it only showed "Music". It also seemed to affect AirPlay and Bluetooth (car).We cannot always reproduce the problems so it is difficult for us to debug. Please advise if there are anything that we need to update regarding iOS 12.2, or any solutions or best practices for implementing an audio player for playlist playback.Thanks.
Posted
by c.leung.
Last updated
.