tags:

views:

470

answers:

4

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 UIView? Anytime I've seen videos on the iPhone it always launches that player interface. Any way to avoid this?

Thanks!

A: 

Only way to avoid using the player interface is to roll your own video player, which is pretty difficult to do right. You can insert a custom overlay on top of the player interface to make it look like the user is still in your app, but you don't actually have control of the view. You might want to try playing your transparent video in the player interface and see if it shows up as transparent. See if there is a property for the background color in the player. You would want to set that to be transparent too.

--Mike

A: 

I'm not sure the iPhone APIs will let you have a movie view over the top of another view and still have transparency.

AlBlue
A: 

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.

alex_c
A: 

Try seting the alpha value of the player's view

RVN