I know that we can create movie player using initWithContentURL: and we can pass NSUrl argument. Here I don’t have NSUrl, I have only NSData. By using it can I create movie player?
I know that we can create movie player using initWithContentURL: and we can pass
Share
There is no method available for initializing the Movieplayer with data.
My suggestion : you need to write the data to document directory as a video file and then initialize the player using that url.
Objective C
Here
datais theNSDataof the video file.You can now use the
appFilevariable for initializing your movieplayer.Swift
Saving File:
Initialising movie player:
Note:
MPMoviePlayerController is deprecated in iOS 9, so you may need to use AVPlayerViewController