changsanjiang / SJBaseVideoPlayer

video player. rotation, volume, brightness, rate, play, pause, stop, seekToTime, present.
MIT License
128 stars 52 forks source link

Can't touch on video when full screen #2

Closed anhnt92 closed 6 years ago

anhnt92 commented 6 years ago

Can you check this class code for me. ` _videoPlayer = [SJVideoPlayer player];

if (globals.currModelVideo.typepost == 1){
    [self.playView.heightAnchor constraintEqualToAnchor:self.playView.widthAnchor multiplier: 9.0/16.0].active = true;
    CGRect frame = self.playView.frame;
    _videoPlayer.view.frame = CGRectMake(0, 0, frame.size.width, frame.size.width/16*9);

}else{
    if (globals.currModelVideo.width<=0){
                [self.playView.heightAnchor constraintEqualToAnchor:self.playView.widthAnchor multiplier: 9.0/16].active = true;
        CGRect frame = self.playView.frame;
        _videoPlayer.view.frame = CGRectMake(0, 0, frame.size.width, frame.size.width/16*9);
    }else{
                [self.playView.heightAnchor constraintEqualToAnchor:self.playView.widthAnchor multiplier: globals.currModelVideo.height/globals.currModelVideo.width].active = true;
        CGRect frame = self.playView.frame;
        _videoPlayer.view.frame = CGRectMake(0, 0, frame.size.width, frame.size.width/globals.currModelVideo.width*globals.currModelVideo.height);
    }
}

[_videoPlayer setDisableGestureTypes:SJDisablePlayerGestureTypes_DoubleTap];
[_videoPlayer setDisableVolumeSetting:YES];
[_videoPlayer setDisableBrightnessSetting:YES];
_videoPlayer.controlLayerDelegate = self;
if (_type_post == 2){
    [_videoPlayer hideForGIF];
}
_videoPlayer.view.alpha = 0.001;
_videoPlayer.delegate = self;

[self.playView.superview addSubview:_videoPlayer.view];

[UIView animateWithDuration:0.5 animations:^{
    _videoPlayer.view.alpha = 1;
}];`

I don't know why?Thanks.

changsanjiang commented 6 years ago

How do you rotate into full screen?

changsanjiang commented 6 years ago

Do you have wechat?

anhnt92 commented 6 years ago

It rotate by default, in SJVideoPlayerDefaultControlView. i do nothing. I just have skype.

changsanjiang commented 6 years ago

Can I see all the code for this controller? I can not think of any other reason.

anhnt92 commented 6 years ago

You can download here : https://secufiles.com/5l25/TGCommentVC.m

changsanjiang commented 6 years ago

OK.

changsanjiang commented 6 years ago

Give me a little time, I study it.

anhnt92 commented 6 years ago

THanks.

changsanjiang commented 6 years ago

You can try to delete the code. Run it.

    _observer = [[SJOrentationObserver alloc] initWithTarget:self.view container:self.view.superview];

    // must imp it.
    _observer.rotationCondition = ^BOOL(SJOrentationObserver * _Nonnull observer) {
        return YES;
    };

And

-(BOOL)shouldAutorotate
{
    return _isShouldRotate;
}

-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}
anhnt92 commented 6 years ago

Its not work. Please help me.

changsanjiang commented 6 years ago

Do you have Twitter?

changsanjiang commented 6 years ago

changsanjiang is me.

anhnt92 commented 6 years ago

Yes, i have. "anhnt592"