0

I was able to get the media stream that OpenTok attaches to video element but looks like OpenTok creates audioContext.createMediaStreamSource from initial mediaStream received from PeerConnection and I get the adjusted one, not the initial.

This causes a problem due to Audio Autoplay Policy that Chrome enables soon and that is on iOS Safari already. If we call session.subscriber() not inside onClick handler (users's gesture) then AudioContext instance is put into suspended state so there is no audio.

I want to disable OpenTok's audioContext, create my own audioContext and manage audio as I want but currently I can't find a way to do it.

GProst
  • 9,229
  • 3
  • 25
  • 47

1 Answers1

1

Adam here from the OpenTok team.

Good to know about the audioContext issue in Chrome with autoPlay. How do you reproduce that issue? Are you actually getting no audio or just the audio level indicator is not working? That's what the audio context is used for.

Have you tried the latest version 2.15.4? We have a fix in there for the autoPlay issue that separates the audio and video into separate elements so that the video can continue to play and then it shows an audio muted icon on top of the video, prompting the user to click it to start the playback of audio.

We don't have a way currently to disable OpenTok's audioContext. I have created a feature request ticket for that internally.

Adam Ullman
  • 1,517
  • 7
  • 12
  • Hey Adam! Thanks for the reply. Actually, I think it was a false alarm from me in regards to Chrome browser autoPlay policy. All works well there, looks like Chrome suspends AudioContext only if there were no users gestures at all by the time of instantiation. But, we did have the issue on iOS Safari where we had to make stream muted by default so that user unmutes it by click. We used 'opentok-react' lib v0.8.0, now using sdk directly. Fetching OpenTok from static.opentok.com (v2) but going to switch to npm. Do you know that issue with iOS or it should be solved once we update sdk version? – GProst Dec 13 '18 at 19:09
  • There is a known bug in our SDK (that we are working on a fix for) that means that the audio level UI in the Subscriber does not work (and neither does the audioLevelUpdated events) in Safari unless you first Publish. Is this what you're referring to as the iOS Safari issue? – Adam Ullman Dec 14 '18 at 04:41