What player can be used to play transparent video in xcode for playing it in ipad?

时光怂恿深爱的人放手 提交于 2019-12-17 17:17:55

问题


I have a video, which is transparent in some portion. When I try to play this video using AVPlayer or MPMoviePlayer, It is not getting played.

Can anyone suggest what player can be used to play a video which has transparent background.

Thanks Suresh S


回答1:


Use AVAnimator - http://www.modejong.com/AVAnimator/

It requires you to transcode it to APNG or their proprietary format, but it works well.




回答2:


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.




回答3:


Suresh

You can try AVPlayerLayer. If you are new to Core Animation you can read a programming guide.

Good luck with your project!



来源:https://stackoverflow.com/questions/6994913/what-player-can-be-used-to-play-transparent-video-in-xcode-for-playing-it-in-ipa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!