-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScreenRecordModule.h
More file actions
85 lines (75 loc) · 3.16 KB
/
ScreenRecordModule.h
File metadata and controls
85 lines (75 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#import <UIKit/UIKit.h>
#import <TVSystemMenuUI/TVSMModuleContentViewControllerDelegate.h>
#import <TVSystemMenuUI/TVSMModuleContentViewController.h>
#import <TVSystemMenuUI/TVSMActionModule.h>
#import <TVSystemMenuUI/TVSMButtonViewController.h>
#import <objc/runtime.h>
@import ReplayKit;
@import UIKit;
@import AVFoundation;
@import AudioToolbox;
// Sound files :P
NSString *recordingStarted = [[NSBundle bundleWithPath:@"/Library/TVSystemMenuModules/ScreenRecordModule.bundle/"] pathForResource:@"recordingStarted" ofType:@"caf"];
NSString *recordingStopped = [[NSBundle bundleWithPath:@"/Library/TVSystemMenuModules/ScreenRecordModule.bundle/"] pathForResource:@"recordingStopped" ofType:@"caf"];
// screen recording file path
NSString *videoPath;
// setting this up allows us to call the private methods if need be
@interface RPScreenRecorder (Private)
@property (nonatomic,retain) UIWindow * windowToRecord;
@property (assign,nonatomic) BOOL systemRecording;
-(void)setWindowToRecord:(UIWindow *)windowToRecord;
-(void)startSystemRecordingWithMicrophoneEnabled:(BOOL)arg1 handler:(void(^)(NSError * error))handler;
-(void)stopSystemRecording:(/*^block*/id)arg1;
-(void)stopRecordingWithVideoURLHandler:(void(^)(id videoURL, NSError *error))arg1;
-(void)stopRecordingWithOutputURL:(id)arg1 completionHandler:(void(^)(NSError * error))arg2;
-(NSURL *)broadcastURL;
-(void)stopSystemRecordingWithURLHandler:(void(^)(id videoURL, NSError *error))handler ;
@end
// show a bulletin when done!
@interface NSDistributedNotificationCenter : NSNotificationCenter
+(id)defaultCenter;
-(void)addObserver:(id)arg1 selector:(SEL)arg2 name:(id)arg3 object:(id)arg4;
-(void)postNotificationName:(id)arg1 object:(id)arg2 userInfo:(id)arg3;
@end
//14+ code (thanks nitoTV)
@interface TVSMButtonViewController (science)
@property (assign,nonatomic) BOOL toggledOn API_AVAILABLE(tvos(14.0));
@property (nonatomic,copy) UIColor *symbolTintColor API_AVAILABLE(tvos(14.0));
@end
// Control Center manager
@interface TVSMSystemMenuManager : NSObject
-(void)dismissSystemMenu;
@end
// Our control center module!
@interface ScreenRecordModule : TVSMActionModule <RPScreenRecorderDelegate> {
// ivars
NSString *packageFile;
TVSMButtonViewController *buttonController;
UIImage *theImage;
AVAudioPlayer *player;
AVAudioPlayer *player2;
NSMutableDictionary *dict;
NSString *notificationImageFile;
UIImage *notificationImage;
NSData *imageData;
RPScreenRecorder *_screenRecorder;
UIViewController<TVSMModuleContentViewController> *_recordingContentViewController;
UIColor *defaultColor;
}
@property (retain, nonatomic) RPScreenRecorder *screenRecorder;
@property (retain, nonatomic) UIViewController<TVSMModuleContentViewController> *recordingContentViewController;
@property (retain, nonatomic) UIAlertController *recordingDoneAlertController;
+(long long)buttonStyle;
-(id)contentViewController;
-(void)handleAction;
-(void)dismissControlCenterAfterRecording;
-(BOOL)dismissAfterAction;
-(BOOL)darkMode;
-(void)setupImageBasedOnToggleStatus;
-(void)playRecordingStarted;
-(void)playRecordingStopped;
-(void)showAlertToUser;
-(void)startRecording;
-(void)stopRecording;
-(void)airdropVideo:(NSString *)path;
@end