-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
I have a video with 360x480 and am playing it on an iPhone4S, but I can see a bit of the underlying imageview image (mainImageView from ASMediaFocusController). Through debug I removed the image and painted the imageview's background red so you can see better what is happening (notice the vertical red near the edges):
The PlayerView has the correct frame, but it's layer isn't filling it, we need to set videoGravity = AVLayerVideoGravityResizeAspectFillfor it to fill completely the PlayerView. Something like:
- (void)showPlayerWithURL:(NSURL *)url
{
self.playerView = [[PlayerView alloc] initWithFrame:self.mainImageView.bounds];
((AVPlayerLayer *)(self.playerView.layer)).videoGravity = AVLayerVideoGravityResizeAspectFill;
...
Doing that the video fills the entire PlayerView as expected.
Metadata
Metadata
Assignees
Labels
No labels
