Failed is a temp state, the delegate will notify and item has failed and content manager will remove this item. In addition, keep in mind that when receiving failed state an error will also be provided in the delegate to indicate the reason.
There is also Removed state which is not displayed here. Removed is a temporary state indicated an item was removed (can be considered as an event). You can remove an item from all states.
Simple Playing Sequence (Using PlayKit Player)
To use the DTG make sure to import in each source file:
The following classes/interfaces are the public API of the library:
ContentManager - Use this class to interact with the library.
DTGContentManager - This is the main API you will use to interact with the library.
ContentManagerDelegate - Delegate calls available to observe.
DTGItem - Represent a single download item.
DTGItemState - The state of a download item.
Basic Implementation with PlayKit:
Make sure to call ContentManager.shared.setup()
(Optional) This is a good place to call ContentManager.shared.startItems(inStates: _) to resume interrupted or in progress downloads.
Note: Make sure to call ContentManager.shared.stop() when finished with playback.