Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Folks here have probably also seen in various other blog posts the following approach to "get the movie-player window" -- at index = 1. Though this approach (see snippet below) is also possibly a bit "fragile", it's likely a bit "safer" since it does <em>not</em> make use of any undocumented or non-public methods in MPMoviePlayerController.</p> <p>Note also that you should wait until you get a MPMoviePlayerContentPreloadDidFinishNotification, so that the movie-player window (idx=1) will indeed exist ;-)</p> <p>Note I'm also assigning an arbitrary (integer-valued) view "tag" to myOverlayView here -- so that I can re-use the view when possible, i.e. check if it's already been added to the parent player window.</p> <p>anyhoo, here's the relevant code-snippet:</p> <pre><code>// use slight "hack" to get our (parent) movie-player window, should always (?) be the UIWindow at index = 1 // UIWindow *moviePlayerWindow= [[[UIApplication sharedApplication] windows] objectAtIndex:1]; myOverlayView.center = CGPointMake( moviePlayerWindow.bounds.size.width - (myOverlayView.bounds.size.height / 2) - myOverlayView.display_origin.y, moviePlayerWindow.center.y ); // center our overlay-view myOverlayView.hidden = NO; // and show it if( [moviePlayerWindow viewWithTag: MY_OVERLAY_VIEW_TAG] == nil ) { // haven't added our overlay-view as a sub-view to the main MoviePlayer window yet... so do that now myOverlayView.tag = MY_OVERLAY_VIEW_TAG; [moviePlayerWindow addSubview: myOverlayView]; } [moviePlayerWindow bringSubviewToFront: myOverlayView]; // in any case, bring it to the foreground </code></pre>
 

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