I have a video, which is transparent in some portion. When I try to play this video using AVPlayer or MPMovieP开发者_如何学编程layer, It is not getting played.
Can anyone suggest what player can be used to play a video which has transparent background.
Thanks Suresh S
Use AVAnimator - http://www.modejong.com/AVAnimator/
It requires you to transcode it to APNG or their proprietary format, but it works well.
You have run into a limitation with the video support provided by Apple under iOS. Specifically, there is no builtin support for video that contains an alpha channel. It is possible to work around this limitation, as shown in this blog post h-264-video-with-an-alpha-channel. If you are not concerned about download size of your app, then you could encode video frames as a series of PNG images. But, be aware that app download size can grow quickly with a series of PNG images. Using h.264 encoded video is a lot more complex but it means that your app download size will be a lot smaller.
Suresh
You can try AVPlayerLayer. If you are new to Core Animation you can read a programming guide.
Good luck with your project!
精彩评论