ethand91 / mediasoup-ios-client Goto Github PK
View Code? Open in Web Editor NEWMediasoup 3 iOS Client
License: ISC License
Mediasoup 3 iOS Client
License: ISC License
Started a SwiftUI project mediasoup client and when started to build the WebRTC framework I found that the below link is broken.
https://webrtc.org/native-code/development/prerequisite-sw/
in v 1.3.3
when i'm try to call transport.produce crash with 'error creating transceiver'
please help me, thanks
[TransportWrapper nativeProduce:listener:track:encodings:codecOptions:appData:]
Hello, not in the demo webRTC does not support vp9, I changed a new webTRC, cause crashes.
I can‘t find a way to reconnect after the app disconnected with server in your demo. Because mediasoup is more higher level than WebRTC.framework, we can't use WebRTC functions to handle the reconnection. So what is the best practice of a reconnection? Should we follow the steps as this: reinit a websocket and recreateTransport -> rejoinRoom -> recreateProducer -> recreateConsumer or mediasoup has another efficient way?
Didn't call onProduce when i'm cal transport.produce
Hello, sorry to bother you again.
I have met the problem that same problem as https://mediasoup.discourse.group/t/failed-to-process-the-bundled-m-section/233. But my server has set pasue when created consumer, and I use latest framework.
And I can reproduce this problem, I start video, close video, and restart video, and this problem happend. When I close producer, I found that it not disposed.
So, I wanna to know that if you can reproduce it?
Thanks!
Without touching the sample-media-server and just changing the config.js listenIps: [ { ip: '192.168.2.2', announcedIp: undefined } ],
to my local IP address it seems that my client application refuses to show any sign of connection. I haven't touched the SSL certs from the sample-media-server repo.
I am using the below pods
pod "mediasoup_ios_client", "~> 1.5.0"
pod "Starscream", "~> 4.0.3"
Starscream made some minor changes so I had to change EchoSocket to the below initialization.
func connect(wsUri: String) throws {
/*
if !wsUri.starts(with: "ws://") || !wsUri.starts(with: "wss://") {
throw SocketError.INVALID_WS_URI
}
*/
if (self.socket != nil && isConnected) {
return
}
let request = URLRequest(url: URL(string: wsUri)!)
// Allow self-signed certificates
// Load certificates and public keys into an app bundle, use the builtin pinner and TrustKit.
let pinner = FoundationSecurity(allowSelfSigned: true) // don't validate SSL certificates
self.socket = WebSocket.init(request: request, certPinner: inner)
// ^^^^^^ Initializing the socket changed to latest Starscream pod ^^^^^^
// Handle socket delegate methods on the global thread (semaphor will lock if not set to global..)
self.socket!.callbackQueue = DispatchQueue.global()
self.socket!.delegate = self
self.socket!.connect()
}
Below is my code, trying to keep it short to make sure I understand the steps.
import Foundation
import Combine
import SwiftyJSON
import WebRTC
final internal class HostBroadcastViewModel: ObservableObject, Identifiable {
public let roomId: String
private let disposables = Set<AnyCancellable>()
private let socket: IMediaSocket
private var room: IRoomManager?
private var roomDelegate: RoomListener?
init(mediaSocket: IMediaSocket, roomId: String) {
socket = mediaSocket
self.roomId = roomId
}
func startBroadcasting() {
self.socket.register(observer: self)
print("Will connect to server")
do {
try self.socket.connect(wsUri: "wss://192.168.2.2:443") // Doesn't throw or any sign of connection
} catch {
print("Failed to connect to server")
}
}
private func handleWebSocketConnected() {
// Initialize mediasoup client
initializeMediasoup()
// Get router rtp capabilities
let getRoomRtpCapabilitiesResponse: JSON = Request.shared.sendGetRoomRtpCapabilitiesRequest(socket: socket, roomId: roomId)
print("response! " + getRoomRtpCapabilitiesResponse.description)
let roomRtpCapabilities: JSON = getRoomRtpCapabilitiesResponse["roomRtpCapabilities"]
print("roomRtpCapabilities " + roomRtpCapabilities.description)
// Initialize mediasoup device
let device: MediasoupDevice = MediasoupDevice.init()
device.load(roomRtpCapabilities.description)
print("handleWebSocketConnected() device loaded")
room = AppDependencyContainer.shared.createMediasoupRoomManager(socket: socket, device: device, roomId: roomId)
roomDelegate = self
room!.roomListener = roomDelegate
// Join the room
do {
try room!.join()
} catch {
print("failed to join room")
return
}
// Create recv webrtcTransport
room!.createRecvTransport()
// Create send webrtcTransport
room!.createSendTransport()
// Start media capture/sending
// self.displayLocalVideo()
}
private func initializeMediasoup() {
Mediasoupclient.initialize()
print("initializeMediasoup() client initialized")
// Set mediasoup log
Logger.setLogLevel(LogLevel.WARN)
Logger.setDefaultHandler()
}
}
extension HostBroadcastViewModel : MessageObserver {
func on(event: String, data: JSON?) {
// Never invoked after connect() is called
switch event {
case ActionEvent.OPEN:
print("socket connected")
self.handleWebSocketConnected()
break
case ActionEvent.NEW_USER:
print("NEW_USER id =" + data!["userId"]["userId"].stringValue)
break
case ActionEvent.NEW_CONSUMER:
print("NEW_CONSUMER data=" + data!.description)
self.handleNewConsumerEvent(consumerInfo: data!["consumerData"])
break
default:
print("Unknown event " + event)
}
}
private func handleNewConsumerEvent(consumerInfo: JSON) {
print("handleNewConsumerEvent info = " + consumerInfo.description)
// Start consuming
room!.consumeTrack(consumerInfo: consumerInfo)
}
}
// Extension for RoomListener
extension HostBroadcastViewModel : RoomListener {
func onNewConsumer(consumer: Consumer) {
print("RoomListener::onNewConsumer kind=" + consumer.getKind())
if consumer.getKind() == "video" {
let videoTrack: RTCVideoTrack = consumer.getTrack() as! RTCVideoTrack
videoTrack.isEnabled = true
// videoTrack.add(self.remoteVideoView) - I have to see how to bind this in SwiftUI
}
do {
consumer.getKind() == "video"
? try room!.resumeRemoteVideo()
: try room!.resumeRemoteAudio()
} catch {
print("onNewConsumer() failed to resume remote track")
}
}
}
Server starting successfully
initializeWorkers() [num:8]
websocket SSL server running on port 443
Config.js
const os = require('os');
module.exports = Object.freeze({
numWorkers: Object.keys(os.cpus()).length,
worker: {
logLevel: 'debug',
logTags: [
'rtp',
'rtcp',
'ice',
'dtls'
],
rtcMinPort: 40000,
rtcMaxPort: 49999
},
router: {
mediaCodecs: [
{
kind: 'audio',
mimeType: 'audio/opus',
clockRate: 48000,
channels: 2,
},
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
}
]
},
webRtcTransport: {
listenIps: [ { ip: '192.168.2.2', announcedIp: undefined } ],
enableUdp: true,
enableTcp: true,
preferUdp: true,
preferTcp: false
}
});
Any help how to debug is appreciated
objc[24967]: Class RTCAudioSessionDelegateAdapter is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729b858) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c234d8). One of the two will be used. Which one is undefined.
objc[24967]: Class DeviceInfoIosObjC is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bc68) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23528). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoCaptureIosObjC is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bcb8) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23578). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCAudioSession is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729b8a8) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c235c8). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCAudioSessionConfiguration is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729b8f8) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23618). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCNativeAudioSessionDelegateAdapter is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729b948) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23668). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCEncodedImage is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729b9c0) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c236e0). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCRtpFragmentationHeader is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729ba10) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23730). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoCapturer is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729ba38) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23758). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoCodecInfo is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729ba88) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c237a8). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoEncoderQpThresholds is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bad8) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c237f8). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoEncoderSettings is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bb50) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23870). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCVideoFrame is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bb78) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c23898). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCDispatcher is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bbf0) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c249a0). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCCameraPreviewView is implemented in both /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x10729bc18) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c249c8). One of the two will be used. Which one is undefined.
objc[24967]: Class RTCCVPixelBuffer is implemented in both /System/Library/PrivateFrameworks/WebCore.framework/Frameworks/libwebrtc.dylib (0x20c5a09a0) and /private/var/containers/Bundle/Application/DB88FAAB-AF8E-405A-92A6-9C54F9B3EC55/Fuu.app/Frameworks/WebRTC.framework/WebRTC (0x106c24ab8). One of the two will be used. Which one is undefined.
Hello, what are the methods for the implementation of mobile screen sharing, thank you for your guidance
How to disable ulpfec?
Hello, the App Store shelf audit suggested that the logger. h in our library also has the same name as the system's private API and needs to be changed
Hello, I have been able to use VP9, thank you very much! However, I ran into a problem that my vp9 encoding was not recognized by the counter. Could you please test whether using vp9 in your place is normal? Thank you very much for your help!
When trying to submit the app, I'm getting a transporter error with version 1.2.3:
[01:06:11]: ERROR ITMS-90685: "CFBundleIdentifier Collision. There is more than one bundle with the CFBundleIdentifier value 'org.webrtc.WebRTC' under the iOS application 'fuu.app'."
ERROR ITMS-90205: "Invalid Bundle. The bundle at 'fuu.app/Frameworks/mediasoup_client_ios.framework' contains disallowed nested bundles."
ERROR ITMS-90206: "Invalid Bundle. The bundle at 'fuu.app/Frameworks/mediasoup_client_ios.framework' contains disallowed file 'Frameworks'."
\nERROR ITMS-90206: "Invalid Bundle. The bundle at 'fuu.app/Frameworks/mediasoup_client_ios.framework' contains disallowed file 'Frameworks'."ifier value 'org.webrtc.WebRTC' under the iOS application 'fuu.app'."
The call to the iTMSTransporter completed with a non-zero exit status: 1. This indicates a failure.
Does the library support broadcasters and SVC? If supported, how do I configure it?
The SendTransportListener protocol requires this method to be implemented:
func onProduce(_ transport: Transport!, kind: String!, rtpParameters: String!, appData: String!, callback: ((String?) -> Void)!)
But the selector that is being sent to the instance is different:
[fuu.WebRtcSendRoom onProduce:kind:rtpParameters:callback:]
[fuu.WebRtcSendRoom onProduce:kind:rtpParameters:callback:]: unrecognized selector sent to instance 0x281964d20
2020-04-05 23:50:23.801767+0200 fuu[807:173143] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[fuu.WebRtcSendRoom onProduce:kind:rtpParameters:callback:]: unrecognized selector sent to instance 0x281964d20'
Hey, thank you for starting this project! However, after importing the frameworks, I cant build (it seems like the lib was only build for iOS-arm64):
ld: warning: ignoring file /Users/asd/Projects/test/test-mediasoup/mediasoup_client_ios.framework/mediasoup_client_ios, building for iOS Simulator-x86_64 but attempting to link with file built for iOS-arm64
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_Device", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
Am I missing something?
Thanks!
One of the issues I've ben stumbling on, is the fact that libmediasoupclient always uses the C++ APIs, while in fact in some cases, specifically MacOS (but probably also others), the video/audio encoders/decoders are defined in the Objective C layer. Since libmediasoupclient uses the default factories not all the features of the platform are explored or used. The fact that the iOS/Mac client does not pass its own factories causes that H264 uses ffmpeg instead of hardware decoding/encoding. I've implemented some fix in my branch as a gap measure to fix it, but I'm not submitting as PR since there might be cleaner way of handling that.
I'm trying to create sendTransport and got error.
*** Terminating app due to uncaught exception 'RuntimeException', reason: '[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal'
I think that problem could be somewhere in iceParameters, iceCandidates or dtlsParameters...
I'm using Codable approach and short extension to encode this parameters before using.
var jsonEncoded: String {
guard let jsonData = try? JSONEncoder().encode(self) else {
fatalError("Encoding error")
}
return String(data: jsonData, encoding: .utf8)!
}
Nothing special. And this encoding worked with MediasoupDevice.load method..
Can someone help me resolve this issue?
please support sctpCapabilities ,thanks
I wanna to analyse the memory and cpu usage problems in my project.
The iOS Mediasoup library contains devices with the same name as the private API, causing the AppStore to be rejected
How to support H264
It happen whem i'm trying to receive 2 and more consumers!
"
Receive: message
SocketNotificationResponse(method: EBSWebRTCiOS.Methods.newConsumer, payload: Optional({
"kind" : "audio",
"appData" : {
"peerId" : "5e900aad9373cc2d9546806d",
"source" : "mic"
},
"type" : "simple",
"peerId" : "5e900aad9373cc2d9546806d",
"id" : "a8c5c217-f7d4-4896-8732-97617679c52b",
"producerPaused" : false,
"producerId" : "2daec80e-721e-4113-97e6-79084fce3a11",
"rtpParameters" : {
"codecs" : [
{
"channels" : 2,
"payloadType" : 100,
"rtcpFeedback" : [
],
"mimeType" : "audio\/opus",
"parameters" : {
"sprop-stereo" : 1,
"usedtx" : 1,
"useinbandfec" : 1,
"minptime" : 10
},
"clockRate" : 48000
}
],
"headerExtensions" : [
{
"parameters" : {
},
"encrypt" : false,
"uri" : "urn:ietf:params:rtp-hdrext:sdes:mid",
"id" : 1
},
{
"id" : 4,
"parameters" : {
},
"encrypt" : false,
"uri" : "http:\/\/www.webrtc.org\/experiments\/rtp-hdrext\/abs-send-time"
},
{
"parameters" : {
},
"encrypt" : false,
"uri" : "urn:ietf:params:rtp-hdrext:ssrc-audio-level",
"id" : 10
}
],
"encodings" : [
{
"ssrc" : 608869349
}
],
"rtcp" : {
"reducedSize" : true,
"mux" : true,
"cname" : "iaBbtBsUsI5\/yaN\/"
},
"mid" : "2"
}
}))
consumeTrack(consumerInfo:)
Optional("{\n "peerId" : "5e900aad9373cc2d9546806d",\n "source" : "mic"\n}")
2020-06-01 13:22:11.186960+0300 EBSWebRTCiOS_Example[371:42689] *** Terminating app due to uncaught exception 'RuntimeException', reason: 'Failed to set remote offer sdp: Duplicate a=mid value '2'.'"
Use instrument test.
mediasoup-ios-client framework too much memory leak.
Hi, sorry for my stupid question, but I need some explanations during the implementation this line of code:
// Communicate with our server app to retrieve router RTP capabilities
NSString *routerRtpCapabilities = [mySignalling request:@"getRouterRtpCapabilities"];
So, can you explain me what is the object "mySignalling" and where can i get it? or create some working demo iOS project - so i can better understand how it works
Thanks
As the title says.
Rebuilding libwebrtc.a with bitcode support should resolve this.
Error:
libc++abi.dylib: terminating with uncaught exception of type nlohmann::detail::type_error: [json.exception.type_error.302] type must be string, but is object
When call function getRtpParameters from Producer
It would be really useful having documentation about the scope of the project, the installation and use guide, etc.
Any help you may need please let us know to the mediasoup team :-)
Thanks for your share!
According to your instructions, I had compiles libwebRTC.a and libmediasoupclient.a.
But when compile source code in Xcode, I got error.
In webrtc module, it's warning "Must define either WEBRTC_WIN or WEBRTC_POSIX."!
I`m not good in c++, Can you tell me how to resolve such as problems as this?
#import "Device.hpp" file not found
#import "Logger.hpp" file not found
#import "Mediasoupclient.h" file not found
...
help me .thank you !
When I leave a room (closing and removing all producers, consumers, transports). About 30mb of memory are not being released.
I was wondering if you've been experiencing the same?
Below some screenshots of my runtime memory view:
(I'd also post your Logger
's data, but seems to be to much data for github to display. If you need it i'll find another way)
https://cocoapods.org/pods/GoogleWebRTC
We can't use mediasoup-ios-client on iOS 13
Thank you very much!
error: mediasoup-ios-client/mediasoup-client-ios/include/Device.h: No such file or directory (in target 'mediasoup-client-ios' from project 'mediasoup-client-ios')
objc[4784]: Class RTCEncodedImage is implemented in both /private/var/containers/Bundle/Application/C6374C37-10CF-4763-8FC7-7C808A2D924B/mediasoup-ios-cient-sample.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x105d96348) and /private/var/containers/Bundle/Application/C6374C37-10CF-4763-8FC7-7C808A2D924B/mediasoup-ios-cient-sample.app/Frameworks/WebRTC.framework/WebRTC (0x10559e760). One of the two will be used. Which one is undefined.
objc[4784]: Class RTCRtpFragmentationHeader is implemented in both /private/var/containers/Bundle/Application/C6374C37-10CF-4763-8FC7-7C808A2D924B/mediasoup-ios-cient-sample.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x105d96398) and /private/var/containers/Bundle/Application/C6374C37-10CF-4763-8FC7-7C808A2D924B/mediasoup-ios-cient-sample.app/Frameworks/WebRTC.framework/WebRTC (0x10559e7b0). One of the two will be used. Which one is undefined.
When I use it, I find that a lot of threads are created. Have you ever encountered?
After about 5 calls, the thread created about 100.
Whether to add stop local video, stop local audio, stop remote video,stop remote audio interface?
@ethand91 objc[4211]: Class RTCAudioSessionDelegateAdapter is implemented in both /private/var/containers/Bundle/Application/62D8A3B1-DE3F-4834-B559-2700962BA893/mediasoup-ios-cient-sample.app/Frameworks/mediasoup_client_ios.framework/mediasoup_client_ios (0x101b4d590) and /private/var/containers/Bundle/Application/62D8A3B1-DE3F-4834-B559-2700962BA893/mediasoup-ios-cient-sample.app/Frameworks/WebRTC.framework/WebRTC (0x101439200). One of the two will be used. Which one is undefined.
Thank for writing this framework.
I met a crash when called -[SendTransport produce:track:encodings:codecOptions] method.
The error log shows as:[ERROR] transport_wrapper::+TransportWrapper nativeProduce:listener:track:encodings:codecOptions:appData: | The associated promise has been destructed prior to the associated state becoming ready.
I'm using version 1.4.1
I pasted the total log in this file.
errorLog.txt
I also found out that the NO.37 issue produced the same error, and I tried the method as MartinP7r said. But it does not work for me.
#37 (comment)
if necessary, I can provide the source project.
Best Regards,
Michael
Support cocoapods so the framework does not need to be uploaded each time.
Due to the dependencies and build steps needed this is pretty hard to implement.
If anyone has any experience uploading objective-C++ frameworks to cocoapods, help would be greatly appreciated.
The libmediasoupclient library uses promises in these case, since you may need to perform an async operation before returning a value. I've fixed this in my branch but was unable to create a PR since I made a few other small unrelated fixes. You can see the commit here: yuvalt@37d8ad9
Hello, may I ask if there is any other way to pack our library? Our pods were not successful
how can I use VP8, when i use VP8, did not work
-(instancetype)initWithNativeConsumer:(NSValue *)nativeConsumer {
self = [super init];
if (self) {
self._nativeConsumer = nativeConsumer;
webrtc::MediaStreamTrackInterface *nativeTrack = [ConsumerWrapper getNativeTrack:self._nativeConsumer];
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track(nativeTrack);
// RTCPeerConnectionFactory *factory = [[RTCPeerConnectionFactory alloc] init];
RTCVideoCodecInfo *info = [[RTCVideoCodecInfo alloc] initWithName:kRTCVideoCodecVp8Name];
RTC_OBJC_TYPE(RTCDefaultVideoDecoderFactory) *decoderFactory = [[RTC_OBJC_TYPE(RTCDefaultVideoDecoderFactory) alloc] init];
RTC_OBJC_TYPE(RTCDefaultVideoEncoderFactory) *encoderFactory = [[RTC_OBJC_TYPE(RTCDefaultVideoEncoderFactory) alloc] init];
[encoderFactory setPreferredCodec:info];
RTCPeerConnectionFactory *factory = [[RTC_OBJC_TYPE(RTCPeerConnectionFactory) alloc] initWithEncoderFactory:encoderFactory decoderFactory:decoderFactory];
self._nativeTrack = [RTCMediaStreamTrack mediaTrackForNativeTrack:track factory:factory];
free(factory);
}
return self;
}
[!] Error installing mediasoup_ios_client
[!] Failed to download 'mediasoup_ios_client': [!] /usr/bin/git -C /var/folders/s0/h_pcj4wj3hxfy4y0k2v8ryz40000gp/T/d20200303-91582-1ivqlky submodule update --init --recursive
Submodule path 'mediasoup-client-ios/dependencies/libmediasoupclient': checked out 'a75cf2a77ef1dd6b0b52b1a16596d65ef8fe6e83'
Submodule 'mediasoup-client-ios/dependencies/libmediasoupclient' (https://github.com/ethand91/libmediasoupclient.git) registered for path 'mediasoup-client-ios/dependencies/libmediasoupclient'
Submodule 'mediasoup-client-ios/dependencies/webrtc/src' (https://github.com/ethand91/webrtc-mac-src.git) registered for path 'mediasoup-client-ios/dependencies/webrtc/src'
Cloning into '/private/var/folders/s0/h_pcj4wj3hxfy4y0k2v8ryz40000gp/T/d20200303-91582-1ivqlky/mediasoup-client-ios/dependencies/libmediasoupclient'...
Cloning into '/private/var/folders/s0/h_pcj4wj3hxfy4y0k2v8ryz40000gp/T/d20200303-91582-1ivqlky/mediasoup-client-ios/dependencies/webrtc/src'...
error: Server does not allow request for unadvertised object fba755df2ea8163a5bbefb7e8e7c58dec433534a
Fetched in submodule path 'mediasoup-client-ios/dependencies/webrtc/src', but it did not contain fba755df2ea8163a5bbefb7e8e7c58dec433534a. Direct fetching of that commit failed.
お疲れ様です!🙂
Thanks for creating this framework.
I've been mostly sticking to the implementation of your sample app https://github.com/ethand91/mediasoup-ios-client-sample
but when
let kindProducer: Producer = sendTransport.produce(producerHandler,
track: track,
encodings: nil, // as suggested by your other issue
codecOptions: codecOptions)
print("test")
is called, it fails silently (test
is not printed) and the RTCEAGLVideoView
(or RTCMTLVideoView
) used to render the VideoTrack
stops showing the video input. I can confirm that the VideoView is working by not calling produce
.
Do you have any idea what I'm missing?
Best Regards,
Martin
I can't understand that crash but there indeed has a declaration in the .h file.
I call this method when i prepared to dispose the sdk and finish a conference.
Maybe i called this method in a wrong way, please correct me, thank you!
PS: I run the sdk with the version: 1.4.1 (upgrade from 1.2.3)
Currently the library supports arm64 and x86_64, however the built framework only supports arm64.
I will look into supporting multiple architectures however due to the size of a fat libwebrtc.a library, I may only support 64 bit. With 32 bit included libwebrtc.a can go over 2GB..
First study mediasoup webrtc
How to modify request.swift for protoo.websocket used by server
What information can I refer to
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.