feat(webrtc): Implement microphone support for cloud sessions#121
Merged
feat(webrtc): Implement microphone support for cloud sessions#121
Conversation
- Added session.setPermissionRequestHandler for microphone permissions - Added session.setPermissionCheckHandler for microphone checks - Added macOS systemPreferences.askForMediaAccess on startup - Fixed SettingsPage to enumerate actual microphone devices - Added Mic icon to settings UI - Shows permission error if mic access is denied Co-authored-by: Capy <capy@capy.ai>
…ermission - Added check in onWindowBlur to skip key release during mic permission request - This prevents mouse/keyboard input from breaking when getUserMedia() causes brief focus loss - The micState === 'permission_pending' check keeps keys pressed during the permission dialog Co-authored-by: Capy <capy@capy.ai>
…eaming - Added useEffect in App.tsx to restore focus to video element when navigating away from Settings - This fixes mouse/pointer lock and fullscreen issues when using F8 or clicking buttons - The focus was being lost to Settings page inputs and not restored Co-authored-by: Capy <capy@capy.ai>
…screen - Added local ref management with setVideoRef callback - Added useEffect to auto-focus video element when stream is ready - Added onClick handler to focus video when clicked - This ensures pointer lock and fullscreen work correctly when interacting with stream Co-authored-by: Capy <capy@capy.ai>
- Allowed fullscreen, automatic-fullscreen, pointerLock, and speaker-selection permissions - Prevents Electron permission handler from blocking requestFullscreen/pointerLock - Fixes user-gesture fullscreen and pointer lock failures in stream Co-authored-by: Capy <capy@capy.ai>
…yboard lock - Attach mic track after remote description and target mid=3 recvonly transceiver - Added MicrophoneManager.attachTrackToPeerConnection for late attachment - Allowed keyboardLock permission in Electron handlers - Improves mic audio send and keyboard lock during fullscreen Co-authored-by: Capy <capy@capy.ai>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR introduces full microphone support, enabling voice chat functionality within cloud gaming sessions. The implementation follows the approach observed in the official GeForce NOW client for compatibility and robustness.
Key changes include:
GfnWebRtcClientnow manages the microphone stream, adding it to the WebRTC peer connection and handling its lifecycle (start, stop, toggle).StreamViewfor quick mute/unmute access.SettingsPagenow includes options to configure microphone mode (disabled, push-to-talk, voice activity) and select the input device.SettingsManager.