-
-
Notifications
You must be signed in to change notification settings - Fork 402
Feature/screenrecording liveactivity #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Feature/screenrecording liveactivity #804
Conversation
|
Could you cherry-pick your commit to keep the git history clean? |
|
Also, how did you prioritize this compared to the other views? |
|
Screen recording live activity is a fairly common feature to people using iPhones > 15 and when I released the first iteration of changes to DynamicIsland - people liked that one specifically as it feels more native Also adding this did not require removing the App Sandbox or adding any other dependencies That's why I chose this feature to be contributed first as this does not feel very out of place as compared to the Stats one which non developers or non tech people will rarely use So yeah that's the reason I picked this thing first |
|
Oh I meant like if different events are happening including screen recording, how is it prioritized? |
|
Oh my bad, I didn't prioritize it - just tried turning on the music visualizer after screen recording and it hides the screen recording indicator Should I place it at the topmost priority so that it doesn't get hidden? |
Alexander5015
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some feedback, feature looks good, just needs some tweaking. I’ll make another pass with more feedback once those changes are made.
| recordingStartTime = Date() | ||
| recordingDuration = 0 | ||
|
|
||
| durationTimer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] _ in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better as a single task that sleeps, rather than a repeating timer that creates new tasks each time. The timer here should also probably be slower, 0.1s is probably unnecessary, and something like 0.3-0.5 would be better I think
| recordingStartTime = nil | ||
|
|
||
| // Keep the last duration for a moment before resetting | ||
| DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { [weak self] in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Swift concurrency instead
| guard let context = context else { return } | ||
| let manager = Unmanaged<ScreenRecordingManager>.fromOpaque(context).takeUnretainedValue() | ||
|
|
||
| DispatchQueue.main.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Swift Concurrency, it also seems like this will lead to multiple main thread hops
| private var debounceIdleTask: Task<Void, Never>? | ||
|
|
||
| // MARK: - Configuration | ||
| private let debounceDelay: TimeInterval = 0.2 // Debounce rapid changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this variable is unused, you should remove it unless it is necessary
Screen Recording Live Acitivity
Screen.Recording.2025-10-20.at.1.23.21.PM.mov
I replicated the screen recording live activity functionality from iOS' Dynamic Island
I tested with QuickTime, OBS, Google Meet, MS Teams and Zoom screenshare - it is working on all of them
I have used the ScreenWatcher Private API for making this - it is event driven - and does not do any kind of polling
Lemme know if you need any changes