Show video when first frame is loaded (no black screen) - ios

I need to find a way to display the view of a MPMoviePlayerController after the first frame of the video is cached.
My App shows the first frame of the video as a png and I want the video then to be shown without the screen going black for a second. How can I do that?

Display that image as a view-overlay on top of your MPMoviePlayerController by adding it as a subview of MPMoviePlayerController.view.
Once the video has started the playback (use the MPMoviePlayerPlaybackStateDidChangeNotification to react upon that), hide / remove your overlay.

Related

IOS youtube player shows white screen while loading

I am integrating youtube player via cocoapods. I am using storyboard, problem is while loading video, youtube player shows blank white space it gives very ugly look to my complete UI. How can I show some sort of loader while it is loading.
I have also tried to use activity indicator behind the player but I guess player view itself has white color which hides my indicator. Also, I tried to use indicator on the player but it kept on showing even if video got load.
And I didn't find any possible solution in delegate by which I can find that weather the video loads or not?
Any possible solution Please????? Thanks in advance.
You can take an imageview on top of your player and set the background to black and in player delegate when player state become ready , set the image background color to clear.
Hope this will work, this works for me.

Setting videoCompostion of AVItemPlayer rotates video

I have to apply filters on videos on playback, to do so I tried to use AVVideoComposition, Specifically this
However, when I set this composition to my playerItem the video rotates completely. By rotate I mean the width becomes the height and vice versa and so the image stretches.
How can I prevent my video from rotating ?
NOTE: When I put the app in the background by clicking on home button, and then open it again I get the correct result.

Capture Video Frames

I have written the code to capture video frames from here.
https://developer.apple.com/library/ios/qa/qa1702/_index.html.
In -(void)CaptureOutout() delegate function, I am displaying the image in UIimageView by simply adding this line of code [self.uiimage setImage:image]. All is working fine but
the problem is that I want to continuously capture the video frames, but it captures only one video frames and display's it. The other video frame is captured when I close and reopens the app. This means the CaptureOutout() function is called only once, but I want to get the continuous video frames and display them as a continuously on image view. Can anybody solve this problem?

How do i animate with a big sprite in ios?

I have to make an animated infographic in iOS. Its consists of about 140 images all 900x700 large. Whats the best approach to do this? I tried CALayerwith indivual images, and also a spritesheet. But it just takes way too long to load and the playback is awful. I also have the animation in a video file, but it needs to be added to a view in a set frame and not be played in full screen.
Try and play the animation video using MPMoviePlayerController. You can play it in a view with custom frame. You can refer the link for sample code too.

Play video file on splash screen

Can I play a video file in the splash screen?
I use Defualt.png and sleep interval method to use static splash screen. Instead of an image, I want to play a video of about 10 sec.
How can I do that?
Just make Default.png to be the first frame of your video. When the application is loaded, start the video. This is something in between. Hope it helps.
No, the default image is shown by the system while your app is loading, so your code isn't running yet (kinda the whole point). Once it is loaded, you can create a media player and play your video.

Resources