How to make video player in swift? - swift

I am making video player in swift. I need add some custom buttons and functionality for standard video player:
1. Playing video from url (server)
2. Showing indicator while loading video like in VK
3. Add custom buttons to control (stop,pause buttons)
I try to use AVKit/AVPlayerViewController, but i cant understand how i can implement my tasks there. Can you give some advise, which is the better way to do this?

Related

Swift Creating a custom video player

I am creating an original video player in swift.The following are used PHPickerviewcontroller,AVPlayer
I was able to select a video from my camera roll and draw the video in the view I specified, but I am unable to control it.Control methods are assumed to be playback and stop by buttons and seek bar.
I am having trouble getting the seek bar and the video I called to work together. Can you please tell me what is the best way to do this? Thank you in advance.

How To Pause Video and show one UIVIEW and again continue with different Video

hi i want to play a video and it pause after a fixed time like 3:12 mm at the same time i want to show one view to user where form is there and when user fill form and submit the button then again play the video.
My Suggestion is use two instance of videoPlayer object. so when pausing first one make it 2nd player to play the video.
And Please use hidden property.

simple custom video player for ios

I am developing an app in which I wanna show the tutorial on how to use the app. For that need a custom video player which should look simple with a single play/pause button, a seeker and a stop button.
I have tried some video players like "videoplayerkit". To use this videoplayerkit I have to install cocoapods(libpods.a). It would be very helpful if anyone help me with a custom third party video player that satisfies my need. In short I need something like this in the picture below
You can try out an example app I created if you would like to see an example of a custom movie player, the Xcode project is at AVSync. This movie player looks exactly like the default iOS movie player, but you can have a look at the code to see how a custom set of controls can be made to control a movie player underneath. This example sits on top on a custom movie library, but the basic idea of creating your own controls and having them submit actions is the same no matter how you implement it.

How to combine 2 CMSampleBufferRef files?

I am trying to capture video using the AV foundation api's. I want to provide functionality to pause the video and restart it. I am trying figure out how to implement the pause feature will work. I was thinking about adding a button which will call the [session stopRunning] method. I would implement AVCaptureVideoDataOutput and capture CMSampleBufferRef each time the video is stopped. I then would like to combine all these into one file and then output it to the camera roll. Does this seem like the right approach?
OR
SHould i implement a pause button and capture video continuously and just throw away the frames when the user has the pause button clicked? If that was the case, then how would i do that?
Thanks in advance!
Instead i am looking into using AVAssetWriter instead of writing seperate vidoes and trying to merge them. Attempting the solution provided here # How do i pause video recording with iPhone SDK?

How to keep MPMoviePlayerController open after movie ended?

If I use MPMoviePlayerController to play video in my iPhone app, it opens, loads the movie, plays it and then closes. Is it possible to force it to stay open after the movie finishes, so that user can replay it using its controls, instead of using controls in parent view? Also, is it possible to start MPMoviePlayerController in the paused mode?
thanks for any advice.
None of that is possible using the available API in the Pre-3.2 OS. One thing you could do is take a scerenshot of the last frame and stick that behind the movie so when it's done playing, it looks like it's still there, then just stick a button on it to replay. you could make an interface that looks/behaves similar to the standard movie player interface just for the play button if you need to.
For anyone stumbling over this now... There is a way to do this. Check out this question :)