Posts

Post not yet marked as solved
7 Replies
The user is selecting different videos and the view is already loaded.
Post not yet marked as solved
5 Replies
The behavior is different with the two lines. The one with self works; the other doesn't. Based on the answers, it is because myImage is an IBOutlet.
Post not yet marked as solved
7 Replies
Yes, I was commenting on your side comment, which was not the original question. My question about the screen sizing is that "frame" was not an option with [UIScreen mainScreen], yet I would think that I would use "frame" instead of "bounds".
Post not yet marked as solved
7 Replies
You are right. The currentMode was giving me twice the resolution. Using width = [UIScreen mainScreen].bounds.size.width; height = [UIScreen mainScreen].bounds.size.height;gave me the correct width and height of the screen. I do not understand why "bounds" is the only option to get the size. I would have thought "frame" would be correct.
Post not yet marked as solved
7 Replies
I seemed to get a good part working by adding the line of code:self.myImage.frame = self.view.frame;just above the [playerLayer addSublayer:playerLayer] lineWhat I don't understand is why it worked for the iPhone without this but not the iPad.
Post marked as solved
1 Replies
Post marked as solved
5 Replies
Replied In AVPlayer
Claude, it seems I am having trouble adding the button to my avplayer. The button never shows when I use avMovie.view or self.view when I try to add the subView. Any suggestions?-(void)playMovie: (NSString *) fileName{ NSLog(@"in playMovie second"); NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource: fileName ofType:@"mp4"]]; AVPlayer *player = [AVPlayer playerWithURL:url]; AVPlayerViewController *avMovie = [[AVPlayerViewController alloc]init]; //AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:player]; avMovie.view.frame = self.view.bounds; avMovie.player = player; //playerLayer.frame = self.view.bounds; //[playerLayer setVideoGravity:AVLayerVideoGravityResizeAspect]; //[self.view.layer addSublayer:playerLayer]; [player play]; //make button UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(30,30,100,60); [button setTitle:@"Done" forState:UIControlStateNormal]; [button addTarget:self action:@selector(myDoneButtonMethod:) forControlEvents:UIControlEventTouchUpInside]; [avMovie.view addSubview:button]; //show view controller [self addChildViewController:avMovie]; [self.view addSubview:avMovie.view]; //avMovie.view.frame = self.view.frame; //[player replaceCurrentItemWithPlayerItem:nil]; //[player pause]; //[avMovie.view removeFromSuperview]; }
Post marked as solved
5 Replies
Replied In AVPlayer
I do appreciate you getting back to me.
Post marked as solved
5 Replies
Replied In AVPlayer
I used[avMovie.view removeFromSuperview];to remove the view. However, the player does not have a "Back/done" button. Do I have to manually code one in or is there a title or subtitle feature that allows me to enter this functionality?
Post not yet marked as solved
4 Replies
I realize how confusing my question sounds. I need to rethink this and find what code I can present.
Post not yet marked as solved
4 Replies
I am looking at an app right now that does this. A user goes to a website (site 1) and the app changes the page (to site 2) the person is viewing on that website. Then, it changes the history of the web address so it only appears the person went to site 2 if he goes to the viewing history.