Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay a video inside a view using MPMoviePlayerController?
    text
    copied!<p>I am trying to play video inside a view so I can move it around, perform layout together with other views, but I can't seem to get it work to using MPMoviePlayerController. I came across this link on <a href="http://iphonedevelopertips.com/video/play-movies-in-portrait-mode-with-mpmovieplayercontroller-using-public-apis.html" rel="nofollow noreferrer">how to play video in portrait mode</a> but this is not possible because the video source is coming from the web and should be playable in different platforms not only on iPhone. </p> <p>I've been successful rotating the video and scaling it but it is still contained in a UIWindow which fills the whole screen. Is there a way to create an intermediate UIWindow but not visible in the current screen, so you can play the video there and probably add subviews and return everything as a UIView where I can place it anywhere? Similar to creating a CGGraphics context draw objects there and output as an image. This would also prevent the current screen from rotating from portrait to landscape. </p> <p>----- 2010/06/22 06:10+08:00 ---</p> <p>IN response to Jasarien's answer (below), actually it is possible to rotate and scale a video. After the video has preloaded it creates another instance of UIWindow which then becomes the keywindow at that moment. By creating a callback selector at MPMoviePlayerContentPreloadDidFinishNotification, it is possible to apply transform modification of the current keywindow. </p> <pre><code>-(void)myMovieFinishedPreloading:(NSNotification*)aNotification { NSArray *windows = [[UIApplication sharedApplication] windows]; UIWindow *moviePlayerWindow = nil; if ([windows count] &gt; 1) { moviePlayerWindow = [[UIApplication sharedApplication] keyWindow]; } CGAffineTransform transform = CGAffineTransformMakeScale(0.5, 0.5); transform = CGAffineTransformRotate(transform, -90.0f*M_PI/180.0f); [moviePlayerWindow setTransform:transform]; } </code></pre> <p>Now my question is now that its part of UIWindow and since UIWindow is a UIView subclass, is it possible to subview this UIView? Also I can't seem to disable the autorotate behavior upon preloading of the video. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload