is it possible to have a QuickTime video with alpha layer (transparency) play on top of a static dynamic background UIView
(i.e. a view that changes occasionally) on the iPad?
Thanks!
The reason why many people fail to export videos with a transparent background is that most video formats and codecs don't support transparency. If you want to avoid the common export mistake, you should remember: transparency only works with the MOV (PNG lossless codec) and GIFs.
The file types that currently support an Alpha (transparency) channel are FLV, F4V, AVI, Quicktime, and WebM. If you're using free programs, you may find they can export in these formats. Often, there will be a named codec for an Alpha channel within the settings of these, or a PNG option.
MP4 in it's current variation and format cannot have transparency at all. Exporting your files into this format will be completely flattened.
Just to clear up the misinformation, you can't use a video with an alpha channel using the built in video logic in iOS. You can create a Quicktime movie encoded with the Animation codec and load the video into a view or layer using AVAnimator. What you can't do is create a H264 video with an alpha channel, that is simply is not supported by iOS.
display movies with an alpha channel under iOS
MPMoviePlayerController has a backgroundView property. The docs state:
This view provides the backing content, on top of which the movie content is displayed. You can add subviews to the background view if you want to display custom background content.
I haven't tried it, but if the video content itself has alpha, it sounds like this view should show up. If you set that view to clear, it may just work...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With