Hi Dave, not at all an expert on this but I think if you want “windowed” playback on iOS you need to abandon AVPlayerViewController and instead use your “own” AVPlayer instance pointed at an arbitrary AVPlayerLayer (which some custom view of yours would host).
Never done it myself but searching on that combo of tech (an AVPlayer and an AVPlayerLayer) might get you started. Cheers. On Thu, May 11, 2017 at 8:33 AM, Dave <d...@looktowindward.com> wrote: > Hi, > > The following code plays a movie file in Full Screen, I’d like to be able > to play a Video inside an arbitrary View with the option to go into full > screen. I’ve searched for info on this seemingly simple task but can’t seem > to find anything useful. I’ve tried setting myPlayerViewController.view.frame > but this doesn’t seem to work. I found some iOS 6 code that I wrote ages > ago which does this, but of course this has changed so much since then….. > > Any help on this greatly appreciated. > > All the Best > Dave > > -(void) viewDidAppear:(BOOL) theAnimatedFlag > { > NSURL* myMovieFileURL; > AVPlayer* myPlayer; > AVPlayerViewController* myPlayerViewController; > CGRect myFrameRect; > > myMovieFileURL = [[NSBundle mainBundle] URLForResource:@"Demo-ENG-EX-001" > withExtension:@"mp4"]; > myPlayer = [[AVPlayer alloc] initWithURL:myMovieFileURL]; > > myPlayerViewController = [[AVPlayerViewController alloc] init]; > myPlayerViewController.player = myPlayer; > > [self presentViewController:myPlayerViewController animated:YES > completion:^ > { > [myPlayer play]; > }]; > } > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/vast.grapes%40gmail.com > > This email sent to vast.gra...@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com