grbaczek / ios_webrtc_videochat Goto Github PK
View Code? Open in Web Editor NEWSample project demonstrating reliable webrtc connection on iOS device
License: MIT License
Sample project demonstrating reliable webrtc connection on iOS device
License: MIT License
Hello,
Firstly, thanks for this project!
After some tests with the demo project, I'm facing to a quality issue. After some seconds of video, the quality drops and some frames drop.
I've identified these logs :
(probe_controller.cc:346): Detected big bandwidth drop, start probing.
<...>
Dropping frame. Too large for target bitrate.
I've tested this project https://github.com/stasel/WebRTC-iOS with a local signaling server, and the video quality is great, with no resolution or fps issue. The weird thing is it seems to be the same WebRTC management, only the signaling server differs.
Have you any idea of which is the issue ?
Thanks
Best
When the following line of code:
if let rtcSessionDescription = try await signalingClient.getRTCSessionDescriptions(
does not get a session description from firebase (due to the host being the first one to connect) it never returns (firebase-ios-sdk 10.14.0). This never ending await causes the try await group.waitForAll() to also hang indefinitely even when a timeout occurs.
Is this an issue you've seen before? Unfortunately I can't run the repo and tests without some changes because I'm on the latest ios / xCode betas, and would like to identify whether or not this issue can be reproduced outside of my environment.
Changes I've made to run on IOS 17 beta:
Am able to successfully run a video / audio chat between an IOS 15.6 and an IOS 17 device, given that the host connects first, then the guest immediately connects within the timeout timeframe.
try await withThrowingTaskGroup(of: Void.self) { group in
group.addTask {
if let rtcSessionDescription = **try await signalingClient.getRTCSessionDescriptions**(
currentPeer.watchKey,
chatRoomId
).first(where: { _ in true }) {
try await webRTCClient.set(remoteSdp: rtcSessionDescription)
connectionStateContainer.info = "Remote SDP set"
if currentPeer == .guest {
let sdp = try await webRTCClient.answer()
try await signalingClient.send(sdp: sdp, chatRoomId: chatRoomId, collection: currentPeer.sendKey)
connectionStateContainer.info = "SDP answer sent"
}
}
}
if currentPeer == .host {
group.addTask {
let sdp = try await webRTCClient.offer()
try await signalingClient.send(sdp: sdp, chatRoomId: chatRoomId, collection: currentPeer.sendKey)
connectionStateContainer.info = "SDP offer sent"
}
}
group.addTask {
for _ in 1...40 {
if webRTCClient.isRemoteDescriptionSet {
return
}
try await Task.sleep(milliseconds: 100)
}
connectionStateContainer.info = "Connection timeout"
throw connectionError.connectionTimeoutError
}
**try await group.waitForAll()**
}
Hello,
I'm trying the sample project, but I'm facing with some issue after creating the room :
(stun_port.cc:604): UDP send of 20 bytes to host stun3.l.google.com:19302 (142.251.125.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun2.l.google.com:19302 (64.233.164.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun.l.google.com:19302 (173.194.76.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun4.l.google.com:19302 (74.125.27.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun1.l.google.com:19302 (142.251.27.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun.l.google.com:19302 (173.194.76.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun2.l.google.com:19302 (64.233.164.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun1.l.google.com:19302 (142.251.27.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun4.l.google.com:19302 (74.125.27.x:19302) failed with error 0 : [0x00000041] No route to host (stun_port.cc:604): UDP send of 20 bytes to host stun3.l.google.com:19302 (142.251.125.x:19302) failed with error 0 : [0x00000041] No route to host
The room is well created in Firebase, "SDP offer sent" is well displayed on the screen. But after some seconds "Connection timeout" is displayed. It looks like the stun servers are not available ? Or maybe I don't understand the WebRTC step?
Tested on wifi or LTE network and no VPN
In any case thanks for this very well-explained repository which allows us to understand webrtc well! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.