This file contains 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
//... | |
func sendOffer() { | |
let peerConnection = getPeerConnection() | |
let mediaConstraints = getMediaConstraints() | |
peerConnection.offer(for: mediaConstraints) { [weak self] (sdp, error) in | |
guard error == nil else { |
This file contains 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
static let LOCAL_VIDEO_TRACK_ID = "Your Local Video Track ID here" | |
static let AUDIO_TRACK_ID = "Your Local Audio Track ID here" | |
//... | |
func createLocalMediaStream() { | |
//... | |
let peerConnectionFactory = RTCPeerConnectionFactory() | |
let localMediaStream = peerConnectionFactory.mediaStream(withStreamId: LOCAL_VIDEO_TRACK_ID) |
This file contains 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
import RxSwift | |
import Foundation | |
example("startWith") { | |
Observable.of("1", "2", "3") | |
.startWith("A") | |
.startWith("B") | |
.startWith("C", "D") | |
.subscribe(onNext: {print($0)}) |