Sunday, May 3, 2026
HomeiOS Developmentios - Avplayer in goal c doesn't play video vertically in full...

ios – Avplayer in goal c doesn’t play video vertically in full display screen in UITableViewCell container

[ad_1]

I’ve a video container UIView in a customized UITableViewCell and i exploit the next code to play a video that’s written vertically from an android machine. For some purpose the video performs vertically however with black gaps left and proper within the video container. It ought to fill the video container vertically and play the video. Beneath is the code i exploit to initialize the playbackcontroller in awakefromnib UITableViewCell class. Any assist appreciated.

self.playbackController = [VideoPlaybackController instantiate];
    self.playbackController.delegate = self;
    self.playbackController.closeButtonHidden = YES;
    self.playbackController.skipButtonHidden = YES;
    self.playbackController.skipButton.hidden = YES;
    self.playbackController.progressControlEnabled = NO;
    self.playbackController.progressControlHidden = YES;
    self.playbackController.playbackControlHidden = YES;
    self.playbackController.videoGravity = AVLayerVideoGravityResizeAspectFill;
    self.playbackController.view.body = self.videoContainer.bounds;
    self.playbackController.view.translatesAutoresizingMaskIntoConstraints = NO;
    [self.videoContainer insertSubview:   self.playbackController.view atIndex:0];
    [self.videoContainer mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.equalTo(self.playbackController.view).with.insets(UIEdgeInsetsZero);
    }];

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments