-
Notifications
You must be signed in to change notification settings - Fork 38
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
feature: ability to easily change videoSource to a specific device id #74
Comments
@deviantfero Did you found any way of doing this? Also, how do you create a publisher in otcore? I am referring to line |
@manish1408 hey, I eventually gave up on this and just designed a UI around the limitation in this case, you can always use the bare OT object to create publishers and then you can use ot-core's session to publish them, so I just create them in the usual standard way I recently ran into this issue again in another project, but since I was not using ot-core it was easy to simply replace the publisher I was using in the session, since I'm managing the state in this instance it's easy to do now, what I think should happen is that you could unpublish the undesired publisher, and add a new one and ot-core state should update accordingly, just as I'm doing in the example, but you can see in the piece of code I pasted there I made a mistake, I just console logged the state I got the first time again instead of fetching it again, so maybe at the time I assumed that ot-core did not handle that correctly, I'm not sure it will now that I see that error, but it should, let me know how it goes for you, just for reference that piece of code could be: const session = this.otCore.getSession();
const otState = this.otCore.state();
const activePublisher = otState.publishers.camera[Object.keys(otState.publishers.camera)[0]];
console.log({ session, otState });
session.unpublish(activePublisher);
session.publish(publisher, (err) => {
if (err) return;
console.log({ session: this.otCore.getSession(), otState: this.otCore.state() });
}); |
Bumping this, are there plans to add support for |
New issue checklist
README
General information
Question or Feature Request
Hi everyone, I'm using accelerator-core in order to easily setup one-to-one calls, but one of the requirements is being able to choose from a select list the device from which I want to stream video and audio, audio is not much of an issue, since I can just
setAudioSource
from the publisher, but setting a different video source is giving me trouble, normally I would kill the old publisher and unpublish it from the session, and publish the new one with the desired video source.I'm feeling there must be a better way to do this using
opentok-core
since if I just use the method described above, the new publisher won't be a part of opentok-core global state, thus loosing track of it and not being able to repeat that action.is there a way I can replace the
camera
publisher inopentok-core
's state? I wouldn't want to recur to thecycleVideo
method of the publisher as some users might have more than two cameras.Also, thank you for building this wrapper, it has been really useful in more than one project, it's really easy to use.
The text was updated successfully, but these errors were encountered: