|
I am currently downloading and caching a video file with the following CacheManager:
And injecting the AVPlayer to my View in this way:
But how could I stream the file file while it is downloading without waiting it for complete? |
|
If you pass the remote URL directly to the |
|
@nemecek-filip it streams the video but the |
|
|
|
@nemecek-filip i tried to implement This is my simple implementation but I think that the problem is on
|
|
I solved the problem integrating ChachingPlayerItem ( https://github.com/neekeetab/CachingPlayerItem ) with Cache ( https://github.com/hyperoslo/Cache )
|
|
Hi, So you get it to work? How you build it, can you give more information? What kind of structure is in the app? |
|
Super helpful stuff. Just one gripe is I don't get how to get the delegate extension code to run before starting the player. I end up having to tap on an audio twice for it to play; I guess this means that the AVPlayer can only play a cached item for whatever reason. I am sure I am messing something up somewhere in the usage of the delegate. Any pointers would be appreciated. |
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.