웹캠에서 비디오/오디오를 수신하는 WebRTC iOS 응용 프로그램을 개발 중입니다. 웹캠 만 비디오 및 오디오를 전송하지만 모바일 장치는 아무 것도 보내지 않습니다.libjingle iOS : 마이크 권한 요청 안 함
저는 CocoaPods의 libjingle_peerconnection 라이브러리 (v11177.2.0)를 사용하고 있습니다.
정상적으로 작동하지만 비디오 및 오디오가 제대로 수신되지만 장치 사용 권한 문제가 있습니다. 처음으로 응용 프로그램을 사용할 때 웹캠에서 비디오를 수신하고 싶을 때 iOS 응용 프로그램에서 마이크 권한을 요청합니다. 기기가 오디오를 전송하지 않고 내 고객이 "앱에서 마이크를 요청하는 이유는 무엇입니까?"라고 말하기 때문에 이는 중요합니다.
카메라에 대한 권한이 필요하지 않으므로 이상합니다.
SDP를 확인한 결과 확인 및 제안 (답안 및 답변)이 잘된 것으로 보입니다. 여기
RTCICEServer *stunServer = [[RTCICEServer alloc]initWithURI:[NSURL URLWithString:@"stun:stun.l.google.com:19302"] username:@"" password:@""];
NSMutableArray *iceServers = [NSMutableArray arrayWithObject:stunServer];
RTCPeerConnectionFactory *factory = [[RTCPeerConnectionFactory alloc]init];
NSArray *peerConnectionConstraints = @[[[RTCPair alloc] initWithKey:@"DtlsSrtpKeyAgreement" value:@"true"]];
RTCMediaConstraints *peerConnectionConstraints = [[RTCMediaConstraints alloc]initWithMandatoryConstraints:peerConnectionConstraints optionalConstraints:nil];
RTCPeerConnection *pConnection = [factory peerConnectionWithICEServers:iceServers constraints:peerConnectionConstraints delegate:self];
NSArray *sdpConstraints = @[[[RTCPair alloc] initWithKey:@"OfferToReceiveAudio" value:@"true"],
[[RTCPair alloc] initWithKey:@"OfferToReceiveVideo" value:@"true"]];
RTCMediaConstraints* sdpConstraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:sdpConstraints optionalConstraints:nil];
[pConnection createOfferWithDelegate:self constraints:sdpConstraints];
는 SDP의 제공이 생성됩니다 :
v=0
o=- 6528383367639880158 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
m=audio 9 RTP/SAVPF 111 103 104 9 102 0 8 127 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:0QOsaBCKhCBBcHz5
a=ice-pwd:/y5snrrO3Qmq37m2aejRbK1E
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=recvonly
a=rtcp-mux
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:x1lfnVdo9lCRa9ykH6759WhY1SnI+dbLjKNbkTl+
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:102 ILBC/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 red/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
m=video 9 RTP/SAVPF 100 101 116 117 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:0QOsaBCKhCBBcHz5
a=ice-pwd:/y5snrrO3Qmq37m2aejRbK1E
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=recvonly
a=rtcp-mux
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:x1lfnVdo9lCRa9ykH6759WhY1SnI+dbLjKNbkTl+
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtpmap:101 VP9/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 goog-remb
a=rtcp-fb:101 transport-cc
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
을 그리고 여기에 웹캠에서 SDP 응답입니다
이
내가 아무 조건 스트림와의 PeerConnection 객체 를 만드는 방법입니다 :v=0
o=- 3699612909 3699612909 IN IP4 0.0.0.0
s=-
c=IN IP4 0.0.0.0
t=0 0
a=msid-semantic: WMS
a=group:BUNDLE audio video
m=audio 1 RTP/SAVPF 111 0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:audio
a=rtcp:9 IN IP4 0.0.0.0
a=rtpmap:111 opus/48000/2
a=rtpmap:0 PCMU/8000
a=sendonly
a=rtcp-mux
a=fmtp:111 minptime=10; useinbandfec=1
a=maxptime:60
a=ssrc:3192391506 cname:[email protected]
a=ice-ufrag:r2kq
a=ice-pwd:6VJu/y0Kbc4iUDQB/1ZrnE
a=fingerprint:sha-256 57:26:29:A5:DD:CD:42:74:C9:A3:BB:C4:67:D1:1C:24:E9:4B:4C:86:6F:93:32:03:52:6B:2B:77:B3:C4:E8:88
m=video 1 RTP/SAVPF 100
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=mid:video
a=rtcp:9 IN IP4 0.0.0.0
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=sendonly
a=rtcp-mux
a=ssrc:455461391 cname:[email protected]
a=ice-ufrag:r2kq
a=ice-pwd:6VJu/y0Kbc4iUDQB/1ZrnE
a=fingerprint:sha-256 57:26:29:A5:DD:CD:42:74:C9:A3:BB:C4:67:D1:1C:24:E9:4B:4C:86:6F:93:32:03:52:6B:2B:77:B3:C4:E8:88
자세히 알 수 있듯이 SDP 제공, 두 medias (오디오 및 비디오) "receiveOnly"이며 SDP 대답 "sendOnly", 그래서 아무 문제가 SDP와 관련이 있다고 가정합니다.
누구나 마이크 사용 권한을 요청하는 이유를 알고 계실 것입니다. 더 많은 정보가 필요하시면 알려주세요.
감사합니다!
내가 도움이되지 수의 경우, 코드/라이브러리와 함께 근무 한 적이없는,하지만 Apple documentation에서 우리가 읽을 수
녹음을 사용하지 않아도 마이크 권한이 필요하다는 것이 그의 문제였습니다. 당신에 따르면, 이것은 여전히 마이크 허가 (?)를 요구하고 문제를 해결하지 못합니다. –