mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
added swipe detection to stop streaming
This commit is contained in:
@@ -57,14 +57,26 @@
|
|||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)edgeSwiped {
|
||||||
|
[_streamMan stopStream];
|
||||||
|
[self returnToMainFrame];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) connectionStarted {
|
- (void) connectionStarted {
|
||||||
NSLog(@"Connection started");
|
NSLog(@"Connection started");
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self.spinner stopAnimating];
|
[self.spinner stopAnimating];
|
||||||
[self.stageLabel setText:@"Waiting for first frame..."];
|
[self.stageLabel setText:@"Waiting for first frame..."];
|
||||||
[self.stageLabel sizeToFit];
|
[self.stageLabel sizeToFit];
|
||||||
|
[(StreamView*)self.view setupOnScreenControls];
|
||||||
|
UIScreenEdgePanGestureRecognizer* swipeGesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self action:@selector(edgeSwiped)];
|
||||||
|
swipeGesture.edges = UIRectEdgeLeft;
|
||||||
|
if (swipeGesture == nil) {
|
||||||
|
NSLog(@"An error occured trying to create UIScreenEdgePanGestureRecognizer");
|
||||||
|
} else {
|
||||||
|
[self.view addGestureRecognizer:swipeGesture];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
[(StreamView*)self.view setupOnScreenControls];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)connectionTerminated:(long)errorCode {
|
- (void)connectionTerminated:(long)errorCode {
|
||||||
|
|||||||
Reference in New Issue
Block a user