Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ android/build
Podfile.lock
WebRTC.xcframework
WebRTC.dSYMs
# but DO commit the interim locally-built release framework vendored in-repo
!/third_party/WebRTC.xcframework
!/third_party/WebRTC.xcframework/**
examples/GumTestApp/package-lock.json
examples/GumTestApp_macOS/package-lock.json
**/.xcode.env.local
Expand Down
4 changes: 4 additions & 0 deletions examples/GumTestApp/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ end
target 'GumTestApp' do
config = use_native_modules!

# StreamWebRTC 148.0.0 is not yet on CocoaPods trunk; vendor the interim
# locally-built RELEASE framework committed under third_party/.
pod 'StreamWebRTC', :path => '../../../third_party'

use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
Expand Down
11 changes: 11 additions & 0 deletions ios/RCTWebRTC/Utils/AudioDeviceModule/AudioDeviceModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,17 @@ import WebRTC
source.refreshStereoPlayoutState()
}

/// Gates whether the audio engine may start/stop for input and output.
/// Used to defer engine start until CallKit activates the AVAudioSession.
public func setEngineAvailability(_ availability: RTCAudioEngineAvailability) -> Int {
source.setEngineAvailability(availability)
}

/// The current engine availability for input and output.
public var engineAvailability: RTCAudioEngineAvailability {
source.engineAvailability
}

// MARK: - RTCAudioDeviceModuleDelegate

/// Receives speech activity notifications emitted by WebRTC VAD.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ protocol RTCAudioDeviceModuleControlling: AnyObject {
func refreshStereoPlayoutState()
func setMuteMode(_ mode: RTCAudioEngineMuteMode) -> Int
func setRecordingAlwaysPreparedMode(_ alwaysPreparedRecording: Bool) -> Int
func setEngineAvailability(_ availability: RTCAudioEngineAvailability) -> Int
var engineAvailability: RTCAudioEngineAvailability { get }
}

extension RTCAudioEngineAvailability {
/// Engine may activate for both input and output (the WebRTC default).
public static let `default` = RTCAudioEngineAvailability(isInputAvailable: true, isOutputAvailable: true)
/// Engine start/stop is gated off for both input and output (e.g. before CallKit
/// activates the AVAudioSession).
public static let none = RTCAudioEngineAvailability(isInputAvailable: false, isOutputAvailable: false)
}

extension RTCAudioDeviceModule: RTCAudioDeviceModuleControlling {
Expand Down
5 changes: 0 additions & 5 deletions ios/RCTWebRTC/WebRTCModule+RTCAudioDeviceModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ - (void)handleADMResult:(NSInteger)result
reject:reject];
}

// TODO: `getEngineAvailability` / `setEngineAvailability` were dropped because the
// Stream WebRTC SDK does not expose `RTCAudioEngineAvailability` / `-setEngineAvailability:`.
// The closest equivalent is `RTCAudioEngineState` via `engineState`, but the
// semantics differ and the JS API isn't consumed anywhere yet.

// TODO: Observer delegate "resolve" methods were skipped because our current
// `AudioDeviceModuleObserver` does not expose async JS-driven resolution hooks;
// the Swift `AudioDeviceModule` wrapper always returns success immediately.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stream-io/react-native-webrtc",
"version": "145.0.0",
"version": "148.0.0",
"repository": {
"type": "git",
"url": "git+https://github.com/GetStream/react-native-webrtc.git"
Expand Down Expand Up @@ -35,7 +35,7 @@
"cpp",
"stream-react-native-webrtc.podspec",
"package.json",
"WebRTC.xcframework.zip",
"third_party",
"app.plugin.js",
"!macos/build",
"!ios/build",
Expand Down
7 changes: 5 additions & 2 deletions stream-react-native-webrtc.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ Pod::Spec.new do |s|
s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox'
s.swift_version = '5.0'
s.dependency 'React-Core'
# WebRTC version from https://github.com/GetStream/stream-video-swift-webrtc releases
s.dependency 'StreamWebRTC', '= 145.10.0'
# WebRTC version from https://github.com/GetStream/stream-video-swift-webrtc releases.
# 148.0.0 is not yet published to CocoaPods trunk. Until it is, consuming apps must
# add the interim podspec to their Podfile:
# pod 'StreamWebRTC', :podspec => '../node_modules/stream-react-native-webrtc/third_party/StreamWebRTC.podspec'
s.dependency 'StreamWebRTC', '= 148.0.0'
# Swift/Objective-C compatibility #https://blog.cocoapods.org/CocoaPods-1.5.0/
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES'
Expand Down
20 changes: 20 additions & 0 deletions third_party/StreamWebRTC.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Pod::Spec.new do |s|
s.name = 'StreamWebRTC'
s.version = '148.0.0'
s.summary = 'Stream WebRTC 148.0.0 — locally-built RELEASE binary vendored in-repo'
s.description = <<-DESC
Interim podspec vendoring a locally-built RELEASE (DCHECKs OFF) 148.0.0
WebRTC.xcframework committed under third_party/ (dSYMs stripped). Built from
the GetStream/webrtc source with `stream_enable_rendering_backend=true`.
Replaces the DCHECK-enabled GitHub release zip (which aborted on call join at
audio_rtp_receiver.cc:136) until 148.0.0 is published to CocoaPods trunk.
Consume from a Podfile with:
pod 'StreamWebRTC', :path => '../node_modules/stream-react-native-webrtc/third_party'
DESC
s.homepage = 'https://github.com/GetStream/webrtc'
s.license = { :type => 'BSD' }
s.author = 'Stream.io Inc.'
s.platform = :ios, '13.0'
s.source = { :git => 'https://github.com/GetStream/webrtc.git', :tag => '148.0.0' }
s.vendored_frameworks = 'WebRTC.xcframework'
end
44 changes: 44 additions & 0 deletions third_party/WebRTC.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>WebRTC.framework/WebRTC</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>WebRTC.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>WebRTC.framework/WebRTC</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>WebRTC.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Loading
Loading