I'm using SwiftyDropbox's getTemporaryLink() to play a video in an AVPlayer. I have six test files, and they all work as expected, except 1.
The one that doesn't work is 41 MB in size (which I would not consider a large video file), the rest are < 22 MB.
I've read the AVFoundation and SwiftDropbox documentation many times and haven't been able to find anything on a maximum file size, though I wouldn't expect a maximum file size for streaming content. I would expect it to continuously play smaller chunks downloaded to memory.
My questions are:
- Is there a file size limit on playing a remote URL in an
AVPlayer? - If not, is there a certain way I need to use
AVPlayerin order to stream these larger files?
I'm using the following code to start the AVPlayer:
self.previewPlayer.replaceCurrentItem(with: AVPlayerItem(url: URL(fileURLWithPath: url)))
self.previewPlayer.play()
Thank-you!
http://clips.vorwaerts-gmbh.de/VfE_html5.mp4remote video worked.let url = URL.init(string: urlStr)instead ofURL(fileURLWithPath: url)for remote content.URL(fileURLWithPath:)is meant for use with the file system; however, it does work with remote paths as well. Whether this is intended, I do not know. I have also found that every other video file in the same Dropbox folder works as expected. The one that doesn't work is larger (41 MB). I'm now wondering ifAVPlayerhas a file size limit.AVPlayerItem. Specifically observe the value ofstatusproperty.