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

JS SDK: switchVideoCameraCapture() doesn't trigger onEndedCallback #5925

Closed
MaZZly opened this issue Dec 15, 2023 · 3 comments · Fixed by ant-media/StreamApp#420
Closed

JS SDK: switchVideoCameraCapture() doesn't trigger onEndedCallback #5925

MaZZly opened this issue Dec 15, 2023 · 3 comments · Fixed by ant-media/StreamApp#420
Assignees

Comments

@MaZZly
Copy link

MaZZly commented Dec 15, 2023

Short description

When calling:

webRTCAdaptor.mediaManager.switchVideoCameraCapture(streamId, deviceId, () => {
    console.log('camera was switched')
})

it doesn't trigger the callback...

Looking at the media_manager.js file it seems the switchVideoCameraCapture()-function doesn't do anything with the onEndedCallback-variable, and when it calls this.setVideoCameraSource(...) it sets onEndedCallback to null instead of passing on the defined onEndedCallback

Environment

n/a

Expected behavior

Callback should be triggered.

Actual behavior

Callback is not triggered

Logs

n/a

@MaZZly
Copy link
Author

MaZZly commented Dec 15, 2023

It also seems that is calls this.setVideoCameraSource(...) with more variables than are defined on the function itself..

@USAMAWIZARD
Copy link
Contributor

Thanks @MaZZly for raising this , I have created a PR to fix this issue,
Please note that the track.stop() is not expected to trigger the ended callback.

as mentioned in the specs below it will be trigger on permission revoked or device ejected

ended Event
The MediaStreamTrack object's source will no longer provide any data, either because the user revoked the permissions, or because the source device has been ejected, or because the remote peer permanently stopped sending data.

@USAMAWIZARD
Copy link
Contributor

ant-media/StreamApp#420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants