Bug 183333

Summary: IOS require Media Access to receive the media
Product: WebKit Reporter: ankitbug94
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Major CC: mmalavalli, youennf
Priority: P2    
Version: Safari 11   
Hardware: iPhone / iPad   
OS: iOS 11   

Description ankitbug94 2018-03-05 08:38:50 PST
I am using Kurento Media Server which is working pretty well in all major browsers except IOS Safari. It is having an issue that the Safari cannot receive media when the user has not provided access to their MediaDevices. As soon as we run the following basic code even on any button click

     Navigator.mediaDevices.getUserMedia({video: true, audio: true}).then(function(){})
 
Then video magically appears. You may verify at https://gobrunch.com I can be available to help to test anyone. Thanks
Comment 1 youenn fablet 2018-03-05 09:15:35 PST
Hi,

can you be more specific about the video not showing?
Do you receive a video track from peer connection.

If so, it might be an autoplay restriction.
You can try enable video controls and click play on the video element.
Or you can try calling video.play() and check the result of the promise.


When user grants access to the camera, autoplay restriction is removed.
Otherwise, the page needs user input to start the video.
Typically, calling video.play() within a callback triggered by user gesture.
Comment 2 ankitbug94 2018-03-05 13:02:41 PST
constraints: {"offerToReceiveAudio":false,"offerToReceiveVideo":true}
Created SDP offer
constraints: {"offerToReceiveAudio":true,"offerToReceiveVideo":false}
Created SDP offer
Local description setv=0
 o=- 2541025084667851894 2 IN IP4 127.0.0.1
 s=-
 t=0 0
 a=group:BUNDLE video
 a=msid-semantic: WMS
 m=video 9 UDP/TLS/RTP/SAVPF 96 98 99 97 100
 c=IN IP4 0.0.0.0
 a=rtcp:9 IN IP4 0.0.0.0
 a=ice-ufrag:sZ4S
 a=ice-pwd:HEpixLljnyrRRQRZzD/9AxyQ
 a=ice-options:trickle
 a=fingerprint:sha-256 21:84:70:E7:28:84:4F:70:FA:88:32:86:E5:BF:EE:52:66:B9:2C:3F:80:A4:D4:07:A5:15:D6:B2:22:1D:1D:DB
 a=setup:actpass
 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=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
 a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
 a=recvonly
 a=rtcp-mux
 a=rtcp-rsize
 a=rtpmap:96 red/90000
 a=rtpmap:98 ulpfec/90000
 a=rtpmap:99 H264/90000
 a=rtcp-fb:99 ccm fir
 a=rtcp-fb:99 nack
 a=rtcp-fb:99 nack pli
 a=rtcp-fb:99 goog-remb
 a=rtcp-fb:99 transport-cc
 a=fmtp:99 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
 a=rtpmap:97 rtx/90000
 a=fmtp:97 apt=96
 a=rtpmap:100 rtx/90000
 a=fmtp:100 apt=99
Local description setv=0
 o=- 8616285388892725780 2 IN IP4 127.0.0.1
 s=-
 t=0 0
 a=group:BUNDLE audio
 a=msid-semantic: WMS
 m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
 c=IN IP4 0.0.0.0
 a=rtcp:9 IN IP4 0.0.0.0
 a=ice-ufrag:uBBZ
 a=ice-pwd:Spbm657imOy4iiXFPwFm8QD6
 a=ice-options:trickle
 a=fingerprint:sha-256 A5:EB:B8:96:07:09:C8:60:CA:EC:B7:22:08:80:C1:AB:5F:B0:3F:6E:5E:BC:15:78:3E:9D:07:9B:99:5D:36:00
 a=setup:actpass
 a=mid:audio
 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
 a=recvonly
 a=rtcp-mux
 a=rtpmap:111 opus/48000/2
 a=rtcp-fb:111 transport-cc
 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:106 CN/32000
 a=rtpmap:105 CN/16000
 a=rtpmap:13 CN/8000
 a=rtpmap:110 telephone-event/48000
 a=rtpmap:112 telephone-event/32000
 a=rtpmap:113 telephone-event/16000
 a=rtpmap:126 telephone-event/8000
SDP answer received, setting remote description
Remote stream:
-[Object]
+[Prototype]
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 1 UDP 2013266431 fe80::589f:865d:1daa:403f 58828 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 1 TCP 1019217151 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 1 TCP 1015022847 fe80::589f:865d:1daa:403f 48445 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 1 UDP 2013266431 172.17.45.53 49984 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 1 TCP 1019216383 172.17.45.53 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 1 TCP 1015022079 172.17.45.53 55529 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 2 UDP 2013266430 fe80::589f:865d:1daa:403f 59839 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 2 TCP 1019217150 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 2 TCP 1015022846 fe80::589f:865d:1daa:403f 46817 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 2 UDP 2013266430 172.17.45.53 47969 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 2 TCP 1019216382 172.17.45.53 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 2 TCP 1015022078 172.17.45.53 52931 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
SDP answer received, setting remote description
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 1 UDP 2013266431 fe80::589f:865d:1daa:403f 48895 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 1 TCP 1019217151 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 1 TCP 1015022847 fe80::589f:865d:1daa:403f 41225 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 1 UDP 2013266431 172.17.45.53 46195 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 1 TCP 1019216383 172.17.45.53 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 1 TCP 1015022079 172.17.45.53 58651 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 2 UDP 2013266430 fe80::589f:865d:1daa:403f 43214 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 2 TCP 1019217150 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 2 TCP 1015022846 fe80::589f:865d:1daa:403f 44641 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 2 UDP 2013266430 172.17.45.53 33863 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 2 TCP 1019216382 172.17.45.53 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote stream:
-[Object]
+[Prototype]
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 2 TCP 1015022078 172.17.45.53 53727 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
constraints: {"offerToReceiveAudio":false,"offerToReceiveVideo":false}
Created SDP offer
Local description setv=0
 o=- 6007311323119760352 2 IN IP4 127.0.0.1
 s=-
 t=0 0
 a=group:BUNDLE video
 a=msid-semantic: WMS 07e1c979-f723-4561-8e72-dd90673515c2
 m=video 9 UDP/TLS/RTP/SAVPF 96 98 99 97 100
 c=IN IP4 0.0.0.0
 a=rtcp:9 IN IP4 0.0.0.0
 a=ice-ufrag:Mhtc
 a=ice-pwd:j7y7Zkkx/QahKpimWwLvw5cr
 a=ice-options:trickle
 a=fingerprint:sha-256 C3:57:BF:40:EF:8B:D7:7A:28:2C:DC:0D:CB:DD:B2:04:61:8C:CD:3A:9B:81:FE:EF:05:1D:3D:D5:8A:37:35:83
 a=setup:actpass
 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=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
 a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
 a=sendrecv
 a=rtcp-mux
 a=rtcp-rsize
 a=rtpmap:96 red/90000
 a=rtpmap:98 ulpfec/90000
 a=rtpmap:99 H264/90000
 a=rtcp-fb:99 ccm fir
 a=rtcp-fb:99 nack
 a=rtcp-fb:99 nack pli
 a=rtcp-fb:99 goog-remb
 a=rtcp-fb:99 transport-cc
 a=fmtp:99 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
 a=rtpmap:97 rtx/90000
 a=fmtp:97 apt=96
 a=rtpmap:100 rtx/90000
 a=fmtp:100 apt=99
 a=ssrc-group:FID 3900351280 1276243592
 a=ssrc:3900351280 cname:4NjehNZ0QKmY2YIy
 a=ssrc:3900351280 msid:07e1c979-f723-4561-8e72-dd90673515c2 d789e65a-af41-44ab-9ef4-de11e1fc78cc
 a=ssrc:3900351280 mslabel:07e1c979-f723-4561-8e72-dd90673515c2
 a=ssrc:3900351280 label:d789e65a-af41-44ab-9ef4-de11e1fc78cc
 a=ssrc:1276243592 cname:4NjehNZ0QKmY2YIy
 a=ssrc:1276243592 msid:07e1c979-f723-4561-8e72-dd90673515c2 d789e65a-af41-44ab-9ef4-de11e1fc78cc
 a=ssrc:1276243592 mslabel:07e1c979-f723-4561-8e72-dd90673515c2
 a=ssrc:1276243592 label:d789e65a-af41-44ab-9ef4-de11e1fc78cc
SDP answer received, setting remote description
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 1 UDP 2013266431 fe80::589f:865d:1daa:403f 52737 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 1 TCP 1019217151 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 1 TCP 1015022847 fe80::589f:865d:1daa:403f 47617 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 1 UDP 2013266431 172.17.45.53 42480 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 1 TCP 1019216383 172.17.45.53 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 1 TCP 1015022079 172.17.45.53 33123 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 2 UDP 2013266430 fe80::589f:865d:1daa:403f 41822 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 2 TCP 1019217150 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 2 TCP 1015022846 fe80::589f:865d:1daa:403f 58681 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 2 UDP 2013266430 172.17.45.53 57183 typ host
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 2 TCP 1019216382 172.17.45.53 9 typ host tcptype active
sdpMid: video
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 2 TCP 1015022078 172.17.45.53 59261 typ host tcptype passive
sdpMid: video
sdpMLineIndex: 0
constraints: {"offerToReceiveAudio":false,"offerToReceiveVideo":false}
Created SDP offer
Local description setv=0
 o=- 9040833911156819857 2 IN IP4 127.0.0.1
 s=-
 t=0 0
 a=group:BUNDLE audio
 a=msid-semantic: WMS 8c0b3ca8-f020-49f8-80b0-df4625be6eee
 m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
 c=IN IP4 0.0.0.0
 a=rtcp:9 IN IP4 0.0.0.0
 a=ice-ufrag:DNVL
 a=ice-pwd:EoO4H98pKbfhpFlRZOry74fK
 a=ice-options:trickle
 a=fingerprint:sha-256 84:53:10:E3:62:A4:45:49:2D:73:08:A9:33:3E:7F:03:3C:22:3F:C7:4C:CE:F4:2D:F8:90:E0:14:78:68:FC:C1
 a=setup:actpass
 a=mid:audio
 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
 a=sendrecv
 a=rtcp-mux
 a=rtpmap:111 opus/48000/2
 a=rtcp-fb:111 transport-cc
 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:106 CN/32000
 a=rtpmap:105 CN/16000
 a=rtpmap:13 CN/8000
 a=rtpmap:110 telephone-event/48000
 a=rtpmap:112 telephone-event/32000
 a=rtpmap:113 telephone-event/16000
 a=rtpmap:126 telephone-event/8000
 a=ssrc:1634056109 cname:xtCe7xrXtgfAWCiQ
 a=ssrc:1634056109 msid:8c0b3ca8-f020-49f8-80b0-df4625be6eee cfc7c3e8-fa4a-4db6-9a59-b26aebbee674
 a=ssrc:1634056109 mslabel:8c0b3ca8-f020-49f8-80b0-df4625be6eee
 a=ssrc:1634056109 label:cfc7c3e8-fa4a-4db6-9a59-b26aebbee674
SDP answer received, setting remote description
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 1 UDP 2013266431 fe80::589f:865d:1daa:403f 41697 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 1 TCP 1019217151 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 1 TCP 1015022847 fe80::589f:865d:1daa:403f 42567 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 1 UDP 2013266431 172.17.45.53 45663 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 1 TCP 1019216383 172.17.45.53 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 1 TCP 1015022079 172.17.45.53 47057 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:1 2 UDP 2013266430 fe80::589f:865d:1daa:403f 32863 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:2 2 TCP 1019217150 fe80::589f:865d:1daa:403f 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:3 2 TCP 1015022846 fe80::589f:865d:1daa:403f 43209 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:4 2 UDP 2013266430 172.17.45.53 58472 typ host
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:5 2 TCP 1019216382 172.17.45.53 9 typ host tcptype active
sdpMid: audio
sdpMLineIndex: 0
Remote ICE candidate received
-[Object]
__module__: kurento
__type__: IceCandidate
candidate: candidate:6 2 TCP 1015022078 172.17.45.53 41825 typ host tcptype passive
sdpMid: audio
sdpMLineIndex: 0

This is my console.log which shows and I am pretty sure that the connection is working properly. I also believe that it is autoplay issue because the audio and video appear all of a sudden as I provide access to media. I tried what you suggested:
I made the controls visible and clicking on it did nothing but one time which is weird.
I also tried to view the Promise but that Promise always remained in pending state and when I closed the media from source, then it showed aborted error. And I did this in click context of window.onclick as you suggested.
Honestly speaking, it worked once as I already wrote when I clicked on the controls without providing access to camera but never again. Thanks
Comment 3 ankitbug94 2018-03-05 13:07:07 PST
I'd appreciate any suggestions from you. What do you think I should test? Thank you!
Comment 4 youenn fablet 2018-03-05 14:16:56 PST
Can you try from the debugger to do the following:
- check that video.srcObject is set to a MediaStream.
- do video.play() and check the result.

You can also try to add the muted attribute to your video object, autoplay restriction should not kick in since video without sound is fine.
That would allow to ensure this is an autoplay issue.
Comment 5 ankitbug94 2018-03-05 14:54:08 PST
1.

-[Object]
-[Prototype]
+[Prototype]
+[Methods]
active: true
id: default
onactive:
onaddtrack:
oninactive:
onremovetrack:

After the audio tag starts to play
[Object]
-[Prototype]
+[Prototype]
+[Methods]
active: true
id: 212720ca-49b1-4792-88ad-305047231eb4
onactive:
onaddtrack:
oninactive:
onremovetrack:

Please notice that it has id when it plays properly. Does having an id=default cause any trouble with playing? 

2. When I did video.play() then it returned a promise and it never resolved and always remained in pending state and when I closed the media from source, then it showed aborted error. And I did this in click context of window.onclick as you suggested. Anything else that I can do to get the response of video.play?

Regarding the muted property, I want to tell you that I am using different MediaStreams for each Track. So AudioTrack is using separate MediaStream and Video is using Different Stream. And also, the stream with audio is using the audio tag which has autoplay enabled but still not working on gobrunch.com and video stream which is without audio is using Video tag. Now, the autoplay issue should not be prevalent in the audio tag, right? But I can assure you that audio tag is not working
1) when Clicking on control of audio tag
2) Triggering audio.play()

but it works as soon as we provide permission

Thank you again for you help
Comment 6 youenn fablet 2018-03-05 15:54:14 PST
Can you check the tracks in video.srcObject media streams and their state...?

Also, it seems your SDP are very different when accessing camera or not, since you have revconly (the case you want I guess) vs sendrecv. So maybe it is not autoplay after all, especially if video.play() promise is not resolved at all.

Maybe you can provide me via email a pointer that would allow me replicate your issue?
Comment 7 youenn fablet 2018-03-06 11:27:18 PST
(In reply to ankitbug94 from comment #0)
> I am using Kurento Media Server which is working pretty well in all major
> browsers except IOS Safari. It is having an issue that the Safari cannot
> receive media when the user has not provided access to their MediaDevices.
> As soon as we run the following basic code even on any button click
> 
>      Navigator.mediaDevices.getUserMedia({video: true, audio:
> true}).then(function(){})

I am not able to reproduce that.
Video remains broken even after navigator.mediaDevices.getUserMedia is on


I also tried between Safari Mac and Safari Tech Preview and this fails exchanging video and audio. ankitbug94, can you confirm that? It seems to work Safari -> Chrome.


Looking at the logs, it seems that RTCPeerConnection::updateIceConnectionState failed.
So maybe it is my network setup that is not good. I'll try to test it later in a different network setup.
Comment 8 ankitbug94 2018-03-06 12:32:40 PST
Hi Youenn,

I have added TURN server on port 443 so no network problem should happen now. 

You will need 2 browsers.

To send the video you need to go to browser1

1) https://brunchlive.net/events/2862/5065
2)Then use email:test1@gobrunch.com password:test to login.

To receive the video you need to go to IOS Safari
1) https://brunchlive.net/events/2862/5065
2) Then use email:test2@gobrunch.com password:test to login. 

Now go to browser1 and click on Broadcast
If the error happens then on IOS safari you will see the video objects without video and audio object without audio.

Now go to browser1 and type "@test mic" in the chat window and hit enter. This basically sends a signal to IOS Safari to start broadcasting which ask for the mediaDevice access. At this time, safari should start to receive the video too with sending.

I have enabled 
1) all the ICE candidates and SDP to be logged into the console
2) The control option on the video and audio tags are also shown

Let me know if you need anything else on the console. I can be available with you there to help you with the user interface :)

Regards
Comment 9 youenn fablet 2018-03-06 13:23:59 PST
ankitbug94, I can hear audio now, is this what you are also reproducing?

If so, the issue is about video not showing.
Looking at the logs again, we are decoding frames but we are dropping them hence not displaying them. I don't know yet why.
Comment 10 ankitbug94 2018-03-06 13:29:05 PST
In my case, both audio, as well as video, does not work till the receiver opens their camera or mic. Not sure why you are able to hear. Sometimes, I see( for unknown reasons and rarely) but can't hear which is opposite of what you are seeing.
Comment 11 youenn fablet 2018-03-06 13:39:11 PST
(In reply to ankitbug94 from comment #10)
> In my case, both audio, as well as video, does not work till the receiver
> opens their camera or mic. Not sure why you are able to hear. Sometimes, I
> see( for unknown reasons and rarely) but can't hear which is opposite of
> what you are seeing.

There might be too issues here:
- to hear audio, you need to tweak your code to start playing audio based on a user gesture.
- to view video, there might be some errors like missing key frames so that decoding is failing, or bad timestamps. This is probably either an issue on webkit side or on server side. It is strange that just calling getUserMedia would fix that issue.
Comment 12 youenn fablet 2018-12-19 08:26:03 PST
Another possibility would be that the connection is not successful.
I would check the PC stats to see whether bytes are being received and video being decoded.
Comment 13 Manjesh Malavalli 2021-09-07 10:17:40 PDT
Youenn,

We observed that, with iOS 14.7.1, the microphone permission has to be granted even for playing remote audio tracks. Is this a change in behavior that was planned? I did not see anything related to this in Safari's release notes.
Comment 14 youenn fablet 2021-09-07 10:28:50 PDT
(In reply to Manjesh Malavalli from comment #13)
> Youenn,
> 
> We observed that, with iOS 14.7.1, the microphone permission has to be
> granted even for playing remote audio tracks. Is this a change in behavior
> that was planned? I did not see anything related to this in Safari's release
> notes.

autoplay policies have not changed: either capture is on, or a user gesture is needed to start audio elements.