Skip to content

Fix an issue that the stream does not start properly on the remote side when the video is turned off #1

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

Merged
merged 4 commits into from
Jun 11, 2025

Conversation

miyamoto83
Copy link

@miyamoto83 miyamoto83 commented May 28, 2025

Fix an issue that the stream does not start properly on the remote side when the video is turned off.

This pull request introduces support for dummy video streams to address compatibility issues in certain browsers where audio streams require accompanying video streams to play correctly. Key changes include adding logic for creating and disposing of dummy canvas streams, modifying conditions for video track handling, and ensuring proper cleanup of dummy streams.

Dummy Video Stream Support:

  • Added videoIsDummy property to LocalTracks class: This property tracks whether the current video stream is a dummy stream. ([static/js/index.jsR68](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94R68))
  • Introduced dummy canvas stream creation and disposal methods: Implemented createDummyCanvasStream and disposeDummyCanvasStream methods to generate and clean up a dummy video stream using a canvas element. ([[1]](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94R531-R575), [[2]](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94R644))
  • Integrated dummy video stream handling in track management: Updated logic to add a dummy video stream when no live video tracks are present and set videoIsDummy accordingly. ([[1]](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94L451-R456), [[2]](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94R497-R499))

Compatibility Improvements:

  • Modified playVideo method: Updated conditions to specifically check for enabled video tracks, preventing indefinite blocking when no video tracks are active. ([static/js/index.jsL629-R679](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94L629-R679))

Activation Logic Adjustment:

  • Added _activated check in RTC message handling: Ensured that RTC messages are processed only when the RTC instance is activated. ([static/js/index.jsL331-R336](https://github.com/NII-cloud-operation/ep_webrtc/pull/1/files#diff-545ec6b75710fc34567f877877c541f0924c8ddde8f96af69489209ef551eb94L331-R336))

@yacchin1205 yacchin1205 changed the title fix something Fix an issue that the stream does not start properly on the remote side when the video is turned off May 29, 2025
@yacchin1205 yacchin1205 self-requested a review June 11, 2025 06:03
@yacchin1205 yacchin1205 merged commit 038f2b8 into NII-cloud-operation:feature/sfu Jun 11, 2025
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