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

feat: clear inactive streams when participant connection is closed #3410

Merged
merged 3 commits into from May 24, 2018

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented May 22, 2018

No description provided.

const audio = this.remote_media_streams.audio;

video(video().filter(stream => !streamIds.includes(stream.id)));
audio(audio().filter(stream => !streamIds.includes(stream.id)));
Copy link
Contributor

@gregor gregor May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are in the scope of observable arrays. You can just do:

const streamIds = streams.map(stream => stream.id);

this.remote_media_streams.audio.remove(stream => streamIds.includes(stream.id));
this.remote_media_streams.video.remove(stream => streamIds.includes(stream.id));

http://knockoutjs.com/documentation/observableArrays.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh true 👍

@atomrc atomrc force-pushed the gvc/memory_release branch 5 times, most recently from 66fde13 to 013575e Compare May 23, 2018 10:13
} else {
connectionMediaStreamTracks = peerConnection
.getRemoteStreams()
.reduce((tracks, stream) => tracks.concat(stream.getTracks()), []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const connectionMediaStreamTracks = peerConnection.getReceivers
  ? peerConnection.getReceivers().map(receiver => receiver.track)
  : peerConnection.getRemoteStreams().reduce((tracks, stream) => tracks.concat(stream.getTracks()), []);

@atomrc atomrc merged commit f555d11 into edge May 24, 2018
@atomrc atomrc deleted the gvc/memory_release branch May 24, 2018 08:29
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.

None yet

2 participants