-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic error reporting #95
Comments
Correct resource loading error propagation requires several conditions which need to be investigated. Until I have more information I updated the current knowledge we have on an existing SRG Content Protection issue. |
Resource loading error propagation is surprising (and really poorly documented 😭). It appears we need:
The first requirement means that we cannot use Swift enums with associated values to model HTTP errors (e.g. using an associated value to store the status code). We also need to be able to associate a description message, so the simplest is likely to use Note that when errors are forwarded to the player item correctly the description is still not associated with the localized description
So another error conversion step is required to deliver a localized error in the end. |
There is still an issue with adding an arbitrary extension: Attempting to play an MP3-backed URN with the m3u8 extension does not work. So we likely need to be a bit smarter. |
The resource loading issue cannot be fixed, at least not if we want to have correct error propagation. The extension appended to any asset URL namely secretly determines how resource loading will work. The result differs whether this extension is missing,
If we provide no extension we can obtain the same effect by providing the MIME type with a private option: let asset = AVURLAsset(url: URLCoding.encodeUrl(fromUrn: urn), options: [
"AVURLAssetOutOfBandMIMETypeKey": "application/x-mpegURL" // or "audio/mpeg"
]) but this only confirms that the behavior of the Since we never know the extension associated with a URN (and we could also have different ones) this proves the current approach is sadly doomed to fail. The current work is not lost, though, as error management is still improved. But we need to completely implement playlist management in a new way so that media compositions are loaded before item creation. |
I'll still merge the changes made in this issue since they are needed to properly load resources and handle errors, but a new approach is required to load assets, otherwise we cannot have at the same time reliable playback and correct error reporting (see #106). |
As a user I want to be informed when playback failed for some reason.
Acceptance criteria
Tasks
CFNetwork
bundle for error localization if helpful.Ensure all medias are playable (e.g. MP3 and HLS).Not possible without a new approach, see Resource loading overhaul #106The text was updated successfully, but these errors were encountered: