I want to be able to play media while caching to a file. There is an option called saveFilePath, also custom extension (I also don't know why I have to set it manually while all my url has extensions) Now I need the library to save file at the given directory and later on when I play it again to use the local copy instead of streaming (Isn't that the importance of caching?)
My current example of implementations is:
let playerItem = CachingPlayerItem(url: url, saveFilePath: "nDNtKz3BQogGuLtg6XRI.mp4", customFileExtension: "mp4")
The error I get:
FileAttribute error: Error Domain=NSCocoaErrorDomain Code=260 "The file “nDNtKz3BQogGuLtg6XRI.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=nDNtKz3BQogGuLtg6XRI.mp4, NSUnderlyingError=0x283d055f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}FileAttribute error: Error Domain=NSCocoaErrorDomain Code=260 "The file “nDNtKz3BQogGuLtg6XRI.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=nDNtKz3BQogGuLtg6XRI.mp4, NSUnderlyingError=0x283d055f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
How do I get this to work. Stream while downloading, later play the downloaded file not streaming again??
I want to be able to play media while caching to a file. There is an option called saveFilePath, also custom extension
(I also don't know why I have to set it manually while all my url has extensions)
Now I need the library to save file at the given directory and later on when I play it again to use the local copy instead of streaming (Isn't that the importance of caching?)My current example of implementations is:
let playerItem = CachingPlayerItem(url: url, saveFilePath: "nDNtKz3BQogGuLtg6XRI.mp4", customFileExtension: "mp4")
The error I get:
FileAttribute error: Error Domain=NSCocoaErrorDomain Code=260 "The file “nDNtKz3BQogGuLtg6XRI.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=nDNtKz3BQogGuLtg6XRI.mp4, NSUnderlyingError=0x283d055f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}FileAttribute error: Error Domain=NSCocoaErrorDomain Code=260 "The file “nDNtKz3BQogGuLtg6XRI.mp4” couldn’t be opened because there is no such file." UserInfo={NSFilePath=nDNtKz3BQogGuLtg6XRI.mp4, NSUnderlyingError=0x283d055f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
How do I get this to work. Stream while downloading, later play the downloaded file not streaming again??