STMURLAsset
is a subclass of AVURLAsset
that can cache data downloaded by AVPlayer
.
Just use it like AVURLAsset
let url = URL(string: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")!
let asset = STMURLAsset(url: url)
asset.preloadAsynchronously()
let playerItem = AVPlayerItem(asset: asset)
let player = AVPlayer(playerItem: playerItem)
let playerView = PlayerView()
playerView.playerLayer.player = player
https://github.com/douking/STMURLAsset
Add the following line to your Podfile:
pod 'STMURLAsset'
STMURLAsset
is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 2 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics