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

Make OTPublisher usable as a preview component. #418

Open
Pyroboomka opened this issue Jun 10, 2020 · 3 comments
Open

Make OTPublisher usable as a preview component. #418

Pyroboomka opened this issue Jun 10, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Pyroboomka
Copy link

Pyroboomka commented Jun 10, 2020

Feature request

Make OTPublisher usable as a preview component.

Description
Basically, I have this call flow:
User enters a "preparation" room, where he can grant permissions for audio/video, make sure that his camera works okay and so on. After doing that, he taps the "Start call" button, gets session_id/token from backend and joins the real call, ready to subscribe to other people streams and publish his own feed.

The problem is OTPublisher is currently unusable without session_id/token, which seems fair.
It is possible to mock preview screen with RNCamera, but when tapping the "Start call" button, which mounts OTSession/OTSubscriber/OTPublisher components, screen goes black for some time until (I guess) OTPublisher is successfully initialized and succeeds in publishing own video.

In web version we are using opentok-accelerator-core, where it is possible to create own video element and make transition seamless with

otCore.startCall({
        publishVideo: true,
        publishAudio: true,
        audioSource: localStreams.audio,
        videoSource: localStreams.video,
      });

It also seems (at least by the docs) opentok-accelerator-core-android has similar feature already implemented, but I'm not sure if this preview component is, again, usable without session_id/token configured.

Proposal
I see this feature as a prop in publisherOptions, something like a boolean flag

      ...
      audioFallbackEnabled: true,
      audioBitrate: 40000,
      frameRate: 30,
      publishStreams: true|false

which makes OTPublisher work without session_id/token, and later when prop is toggled and session_id/token is provided, it hooks up and starts acting as a correctly initialized OTPublisher.

I checked the source code, and without native experience, this feature seems quite daunting (well, not flipping some boolean flags lol)

Thats for joining my ted talk

Links / references
https://github.com/opentok/accelerator-core-android
https://github.com/opentok/accelerator-core-js

@msach22
Copy link
Contributor

msach22 commented Jun 10, 2020

Thanks for filing the detailed issue @Pyroboomka. Unfortunately, this is a current limitation of the library. Please note that this library is not officially supported so it's on a best effort basis. We'll see if we can refactor the library to allow for this feature.

@kuasha420
Copy link

This will be a very useful feature. Please consider it .

@abdulajet abdulajet added the enhancement New feature or request label May 17, 2021
@Panda-ref
Copy link

Few years later this library is now officially supported. Could perhaps this be prioritised?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants