jgh- / VideoCore-Inactive

*No longer in development* Please see https://github.com/unpause-live/SwiftVideo
MIT License
1.48k stars 540 forks source link

When application enter background and then enter foreground application will crash #253

Open jassadakorn opened 8 years ago

jassadakorn commented 8 years ago

screen shot 2559-01-05 at 1 57 21 pm

This is break point in StreamSession.mm

Can you help me resolve this issue?

maxcampolo commented 8 years ago

Stop the stream when you go to background and restart it when you enter foreground again.

shravanteegala commented 8 years ago

to manage my session whenever I want without a crash ! Use this if (_session) {

for (UIGestureRecognizer *recognizer in _session.previewView.gestureRecognizers) {
     [_session.previewView removeGestureRecognizer:recognizer];
}
[_session.previewView removeFromSuperview];
 _session = nil;

}

you put this code Add Observer using ApplicationDidEnterBackGround Notification.

Jatindave commented 8 years ago

Stop the stream when you go to background and restart it when you enter foreground again.

-(void)appWillResignActive:(NSNotification_)note { [session pauseCapture]; } -(void)appBecameActive:(NSNotification)note { [_session resumeCapture]; }

artFintch commented 7 years ago

Hey! Probably I fixed this issue #348