0

I am trying to play a video with AVPlayer but I don't have the URL for it saved, I do have the NSData of the video saved in Core Data however. Is it possible to covert NSData into a NSURL? Or should I just save all the videos into say the documents folder and reference those.

1 Answer 1

1

Yes, you should save the videos in the documents directory, and save the names of the videos in Core Data. It's possible to save arbitrary binary data in Core Data but it's not always a good idea. It's especially not a good idea if the way you need to use that data requires a file URL. You could keep the videos in Core Data and work around it (e.g. by reading them from Core Data and saving them to a temporary location) but that's a lot slower and uglier than just putting them in files to begin with.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.