opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
210 stars 155 forks source link

Subscribers are not able to hear/see the audio/video from a video played while screen sharing #502

Open Kunal-KP opened 3 years ago

Kunal-KP commented 3 years ago

Bug Report

Current behavior When the publishers shares their screen which plays a video in a webview, none of the subscribers are able to see the video, nor are they able to hear the audio from the video. The video screen shows a dormant screen. Even the publishers own audio is not audible.

Steps to reproduce 1) Start a session containing many participants. 2) Allow the publisher to share their screen which plays a video in a webview. 3) The video and audio works fine on the publisher's end but none of the other participants are able to see the video nor are they able to hear the audio from the video. Moreover, the publishers own audio is also not audible. 4) The screen sharing works perfectly fine while sharing PDF's and other non multimedia content.

Example Project As soon as screen share button is clicked, a second instance of OTPublisher component is created having videoSource='screen' in its publisher properties. But once the video starts playing, it is disabling the audio from the initial OTPublisher component and also neither the audio is heard nor the video is visible to the participants from the video that is being played on the webview

What is the current bug behavior? When the publishers shares their screen which plays a video in a webview, none of the subscribers are able to see the video, nor are they able to hear the audio from the video. The video screen shows a dormant screen. Event the publishers own audio is cut off.

What is the expected correct behavior? The subscribers should be able to see the video and hear the audio from the video that the publisher has shared. Also the subscribers should be able to hear the publishers own voice.

Relevant logs and/or screenshots Initially we have a single OTPublisher component where videoSource='camera': <OTPublisher properties={publisherProperties} eventHandlers={this.publisherEventHandlersOne} style={streamStyle} /> As soon as screen share button is clicked, a new OTPublisher component is created with videoSource='screen' in its publisher properties

msach22 commented 3 years ago

Maybe @ggoldens or @enricop89 can help :)

abdulajet commented 3 years ago

hey @Kunal-KP can you share a project with the broken behavior so someone can take a look and help

Kunal-KP commented 3 years ago

Hi @abdulajet, let me try to explain the scenario with a couple of snippets:

When i am clicking on share screen button i am creating a new object: {isScreenShareEnabled ? ( <OTPublisher properties={{ videoSource: 'screen', publishVideo: true, publishAudio: true }} eventHandlers={this.publisherEventHandler} /> ) : null}

and navigating to a screen which has a webview(react-native-webview package) rendering PDF's, multimedia files etc.:

  <WebView
        ref={(webview) => {
          this.myWebView = webview;
        }}
        allowsInlineMediaPlayback
        style={{ flex: 1, marginTop: 20 }}
        originWhitelist={['*']}
        allowFileAccess
        source={{ uri: fileURLPath }}
        allowUniversalAccessFromFileURLs
        javaScriptEnabled
        domStorageEnabled
        onMessage={this.onWebViewMessage}
        cacheEnabled={false}
        allowingReadAccessToURL={content_path}
        mediaPlaybackRequiresUserAction={false}
        injectedJavaScript={webViewJs}

      />

Please note: The screen share works perfectly fine for PDF's and animations and the participants are able to see the content and also simultaneously hear the audio of the presenter, but in case of multimedia content having audio/video, as soon as the multimedia content is loaded on the webview and the screen is shared, the audio of the presenter is no more audible to the participants and the participants cannot see the video or hear the audio being screen shared from the multimedia content.

The functionality works fine from the presenter's end i.e. they can hear the audio and see the video from the multimedia content rendered from the webview.

The problem exists where the audio/video from the multimedia content is unable to be streamed to the participants via the opentok-react-native sdk.

Hope you can help me with this issue.

stanciualex commented 2 years ago

any fix/workaround @Kunal-KP ?

kundanthe commented 1 year ago

Any fix you got @Kunal-KP ?

sangampandey commented 1 year ago

@stanciualex @kundanthe I had similar issue whenever you screen share the audio stream is never passed from opentok you need to getMicStreams and pass it to the OpenTok API.

pietgk commented 11 months ago

any status update?

beHaze commented 1 month ago

We have released 2.27.6 (2.28.0 coming this week) please try with these versions. Reach out to Vonage support (https://api.support.vonage.com/hc/en-us) if you’re still facing issues.