Skip to content

fix: use MediaStreamTrack.findOrCreate() to prevent duplicate track objects losing onended callback#12

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/debug-js-callback-issue
Draft

fix: use MediaStreamTrack.findOrCreate() to prevent duplicate track objects losing onended callback#12
Copilot wants to merge 3 commits into
masterfrom
copilot/debug-js-callback-issue

Conversation

Copilot AI commented Mar 30, 2026

Copy link
Copy Markdown
  • Use MediaStreamTrack.findOrCreate() in MediaStream.create() (audio + video loops)
  • Use MediaStreamTrack.findOrCreate() in MediaStream.js onEvent addtrack case
  • Use MediaStreamTrack.findOrCreate() in RTCPeerConnection.js onEvent track case
  • www/cordova-plugin-iosrtc.js updated — only the 4 bug-fix lines changed, no unrelated debug() library changes

Copilot AI and others added 2 commits March 30, 2026 22:26
Agent-Logs-Url: https://github.com/iotum/cordova-plugin-iosrtc/sessions/e9cc665f-c743-4dcf-9087-941f6a105303

Co-authored-by: rex-iotum <64922037+rex-iotum@users.noreply.github.com>
…bjects losing onended callback

Agent-Logs-Url: https://github.com/iotum/cordova-plugin-iosrtc/sessions/e9cc665f-c743-4dcf-9087-941f6a105303

Co-authored-by: rex-iotum <64922037+rex-iotum@users.noreply.github.com>
@rex-iotum

rex-iotum commented Mar 30, 2026

Copy link
Copy Markdown

Context: There is a desync between iosrtc native and facetalk JS when the MediaStream is torn down and MediaStreamTracks are stopped. It does not emit any events to the JS context.

This is an attempt to emit and update the JS for any changes. So after hold the track.enabled will be accurate.

This is also optional. We don't need it, it'll just be good for the future.

https://github.com/iotum/cordova-plugin-iosrtc/tasks/54f6de69-0d18-4480-bc49-20519f504baa?author=rex-iotum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants