Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate session connection and Publish,Subscribe timing. #582

Closed
kazama-wip opened this issue Mar 11, 2022 · 3 comments
Closed

Separate session connection and Publish,Subscribe timing. #582

kazama-wip opened this issue Mar 11, 2022 · 3 comments
Labels
question Further information is requested

Comments

@kazama-wip
Copy link

Feature Request

Description

We want to mount each item at any given time.
Currently implementation with the code below is not possible and will result in an error.

       <OTSession
          apiKey={apiKey}
          sessionId={sessionId}
          token={token}
          eventHandlers={sessionEventHandlers}
          >
          {status === 'AcceptCall' && (
            <>
              <OTPublisher
                eventHandlers={OTPublisherEventHandlers}
                properties={{
                  videoTrack: false,
                  audioTrack: true,
                  publishVideo: false,
                  publishAudio: true,
                  audioFallbackEnabled: true
                }}
              />
              <OTSubscriber
                properties={{
                  subscribeToVideo: false,
                  subscribeToAudio: true
                }}
              />
            </>
          )}
        </OTSession>

`` Warning: Failed prop type: Invalid prop `children` supplied to `OTSession`. ``

The only way to achieve accurate call functionality is to subscribe to the call status on another server or to cancel or terminate the call by specifying the number of seconds.

Also, the current documentation, which does not explain these features, caused me a lot of trouble when implementing basic call features such as accepting and rejecting calls.

Please let me know if this is a rudimentary question or if I'm doing something wrong.

@enricop89
Copy link
Contributor

Why do you need to only connect and not publish or subscribe? Can you elaborate your use case please?

@abdulajet abdulajet added the question Further information is requested label May 30, 2022
@kazama-wip
Copy link
Author

Thanks for the reply.

The only way to achieve accurate call functionality is to subscribe to the call status on another server or to cancel or terminate the call by specifying the number of seconds.

One of the basic functions of a call is that the party initiating the call may wish to cancel it for some reason.
In such a case, the party receiving the incoming call will receive this information.

@jeffswartz
Copy link
Collaborator

Try using a ternary:

  {status === 'AcceptCall' ? (
    <>
      <OTPublisher
        eventHandlers={OTPublisherEventHandlers}
        properties={{
          videoTrack: false,
          audioTrack: true,
          publishVideo: false,
          publishAudio: true,
          audioFallbackEnabled: true
        }}
      />
      <OTSubscriber
        properties={{
          subscribeToVideo: false,
          subscribeToAudio: true
        }}
      />
    </>
  ) : (
    <></>
  )}

Also, you can conditionally render subscribers. See https://tokbox.com/developer/guides/subscribe-stream/react-native/#custom_rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants