ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.35k stars 413 forks source link

Can't disable rotation of camera #117

Open Offek opened 6 years ago

Offek commented 6 years ago

Hello,

I'm trying to disable the autorotation of the camera aspect ratio, but it seems impossible. I tried disabling interfaceOrientation NSNotifications and app orientations but nothing seemed to work. Could you please help me figure it out?

Thanks in advance.

atiqmumtaz507 commented 6 years ago

Hi,

try to run this command

-(void)disable_rotation {

dispatch_async(dispatch_get_main_queue(), ^{

    int counter = 0;
    while([UIDevice currentDevice].generatesDeviceOrientationNotifications)
    {
        [self disable_rotation];
        counter++;
        if(counter>30)
            break;
    }

});

}