• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iOS AVPlayerViewController and AVPlayer Documentation/Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iOS AVPlayerViewController and AVPlayer Documentation/Help


  • Subject: iOS AVPlayerViewController and AVPlayer Documentation/Help
  • From: Dave <email@hidden>
  • Date: Thu, 11 May 2017 14:33:36 +0200

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iOS AVPlayerViewController and AVPlayer Documentation/Help
      • From: Peter Tomaselli <email@hidden>
  • Prev by Date: Re: Repository of older (outdated) PDF Guides?
  • Next by Date: Re: iOS AVPlayerViewController and AVPlayer Documentation/Help
  • Previous by thread: Re: Repository of older (outdated) PDF Guides?
  • Next by thread: Re: iOS AVPlayerViewController and AVPlayer Documentation/Help
  • Index(es):
    • Date
    • Thread