forked from livekit/react-native-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: screen share audio #28
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1a6bdbb
feat: added captured audio for screen sharing for Android
greenfrvr c4637a2
feat: added in app screen sharing
greenfrvr 1364e73
feat: handle screen capturing on app state changes
greenfrvr bc5de6a
feat: added ios screen share audio capturing
greenfrvr f64916f
chore: adjusted android mix summing
greenfrvr e34e257
chore: ios moved to mixer node implementation
greenfrvr 3691b7e
chore: removed diagnostic logs
greenfrvr 9fa28d3
chore: added in app screen sharing restoration
greenfrvr b099459
chore: code cleanup
greenfrvr 160d8b1
chore: made mixer initialization lazy
greenfrvr 351879c
chore: pr comment fix
greenfrvr 7e4c015
chore: audio capture improvement
greenfrvr f8929b5
chore: code cleanup
greenfrvr c1b1d6c
chore: small tweak
greenfrvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #import <Foundation/Foundation.h> | ||
| #import "CaptureController.h" | ||
| #import "CapturerEventsDelegate.h" | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
|
|
||
| @class InAppScreenCapturer; | ||
|
|
||
| @interface InAppScreenCaptureController : CaptureController | ||
|
|
||
| - (instancetype)initWithCapturer:(nonnull InAppScreenCapturer *)capturer; | ||
|
|
||
| /// The underlying RPScreenRecorder-based capturer. | ||
| @property(nonatomic, strong, readonly) InAppScreenCapturer *capturer; | ||
|
|
||
| @end | ||
|
|
||
| NS_ASSUME_NONNULL_END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #if TARGET_OS_IOS | ||
|
|
||
| #import "InAppScreenCaptureController.h" | ||
| #import "InAppScreenCapturer.h" | ||
|
|
||
| @interface InAppScreenCaptureController () <CapturerEventsDelegate> | ||
| @end | ||
|
|
||
| @implementation InAppScreenCaptureController | ||
|
|
||
| - (instancetype)initWithCapturer:(nonnull InAppScreenCapturer *)capturer { | ||
| self = [super init]; | ||
| if (self) { | ||
| _capturer = capturer; | ||
| _capturer.eventsDelegate = self; | ||
| self.deviceId = @"in-app-screen-capture"; | ||
| } | ||
| return self; | ||
| } | ||
|
|
||
| - (void)dealloc { | ||
| [self.capturer stopCapture]; | ||
| } | ||
|
|
||
| - (void)startCapture { | ||
| [self.capturer startCapture]; | ||
| } | ||
|
|
||
| - (void)stopCapture { | ||
| [self.capturer stopCapture]; | ||
| } | ||
|
|
||
| - (NSDictionary *)getSettings { | ||
| return @{ | ||
| @"deviceId": self.deviceId ?: @"in-app-screen-capture", | ||
| @"groupId": @"", | ||
| @"frameRate": @(30) | ||
| }; | ||
| } | ||
|
|
||
| #pragma mark - CapturerEventsDelegate | ||
|
|
||
| - (void)capturerDidEnd:(RTCVideoCapturer *)capturer { | ||
| [self.eventsDelegate capturerDidEnd:capturer]; | ||
| } | ||
|
|
||
| @end | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #import <AVFoundation/AVFoundation.h> | ||
| #import <WebRTC/RTCVideoCapturer.h> | ||
| #import "CapturerEventsDelegate.h" | ||
|
|
||
| NS_ASSUME_NONNULL_BEGIN | ||
|
|
||
| @interface InAppScreenCapturer : RTCVideoCapturer | ||
|
|
||
| @property(nonatomic, weak) id<CapturerEventsDelegate> eventsDelegate; | ||
|
|
||
| /// Callback invoked for each .audioApp CMSampleBuffer from RPScreenRecorder. | ||
| /// Set this before calling startCapture if audio mixing is desired. | ||
| @property(nonatomic, copy, nullable) void (^audioBufferHandler)(CMSampleBufferRef); | ||
|
|
||
| - (instancetype)initWithDelegate:(__weak id<RTCVideoCapturerDelegate>)delegate; | ||
| - (void)startCapture; | ||
| - (void)stopCapture; | ||
|
|
||
| @end | ||
|
|
||
| NS_ASSUME_NONNULL_END |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.