iOS - How to play a video with transparency?

前端 未结 8 1382
情书的邮戳
情书的邮戳 2020-11-29 06:38

I recorded a video with a bluescreen. We have the software to convert that video to a transparent background. What\'s the best way to play this video overlaid on a custom

8条回答
  •  日久生厌
    2020-11-29 07:06

    You can't avoid launching the player interface if you want to use the built-in player.

    Here's what I would try:

    • get the new window that is created by MPMoviePlayerController (see here)
    • explore the view hierarchy in that window, using [window subviews] and [view subviews]
    • try to figure out which one of those views is the actual player view
    • try to insert a view BEHIND the player view (sendSubviewToBack)
    • find out if the player supports transparency or not.

    I don't think you can do much better than this without writing your own player, and I have no idea if this method would work or not.

    Depending on the size of your videos and what you're trying to do, you could also try messing around with animated GIFs.

提交回复
热议问题