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

Receive audio only or video only #25

Merged
merged 9 commits into from
Nov 17, 2017
Merged

Receive audio only or video only #25

merged 9 commits into from
Nov 17, 2017

Conversation

leaysgur
Copy link
Contributor

@leaysgur leaysgur commented Nov 16, 2017

refs #23

  • check requested feature
  • test all 36 patterns locally
  • implementation
  • docs
  • manual test
  • unit test

@leaysgur leaysgur changed the title [WIP] Receive audio only or video only Receive audio only or video only Nov 16, 2017
@alanmshelly
Copy link
Contributor

All 36 patterns tested! 🎉

LGTM!


We have to discuss which version to add it to.
It adds functionality so I think we should increment the minor version but the 1.1.0 branch has a commit that's not ready for production yet. Also, 1.0.2 has commits that don't affect end user functionality.

The options I can think of are:

  1. rename the 1.1.0 branch to 1.2.0 (or even 1.X.0), the 1.0.2 branch to 1.1.0 and merge this to the new 1.1.0
  2. merge 1.0.2 to 1.1.0 and this PR to 1.1.0. Ignore the codec selection changes that don't work yet since the server doesn't handle them
    • the demerit with this is that the codec selection options will show up on IDEs

Any other suggestions?

@leaysgur
Copy link
Contributor Author

rename the 1.1.0 branch to 1.2.0 (or even 1.X.0), the 1.0.2 branch to 1.1.0 and merge this to the new 1.1.0

+1 for option 1.
And I think, we should not merge 1.2.0 features (like codec selection) into any release branch until it can be shipped.

Copy link
Contributor

@iwashi iwashi left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I have a few comments to asking a favor. Could you modify slightly the codes if my comments make sense to you?

sinon.stub(videoOnlyStream, 'getVideoTracks').returns([{}]);
});

it('should returns correct state with audio and video stream', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for comprehensive test cases! 👍 👍 👍

};

const stream = options.stream;
const hasStream = stream instanceof MediaStream;
Copy link
Contributor

Choose a reason for hiding this comment

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

(This is my preference)
I think using options.stream directly is fine because the name options.stream sounds self-explanatory.

const hasStream = options.stream instanceof MediaStream;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Variable stream is used after this line too for simplicity. But it's ok, I'll fix them.

const stream = options.stream;
const hasStream = stream instanceof MediaStream;
const hasAudioTrack = hasStream ? stream.getAudioTracks().length !== 0 : false;
const hasVideoTrack = hasStream ? stream.getVideoTracks().length !== 0 : false;

const hasStream = options.stream instanceof MediaStream;
const hasAudioTrack = hasStream ? options.stream.getAudioTracks().length !== 0 : false;
const hasVideoTrack = hasStream ? options.stream.getVideoTracks().length !== 0 : false;

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, this depends exactly on personal preference; I just prefer cutting assigning variable sometimes.

state.video = true;
}

// If stream has track, ignore options
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add the comment that expresses having stream track leads to sendrecv like below?

// If stream has track, ignore options, which results in setting sendrecv internally.

The reason of my comment is just for code readability and wants to stimulate my memory when I'll read the code in the future.

@iwashi
Copy link
Contributor

iwashi commented Nov 16, 2017

LGTM 👍

@iwashi
Copy link
Contributor

iwashi commented Nov 16, 2017

  1. rename the 1.1.0 branch to 1.2.0 (or even 1.X.0), the 1.0.2 branch to 1.1.0 and merge this to the new 1.1.0

+1 to this option too 😸

@iwashi iwashi changed the base branch from master to v1.1.0 November 17, 2017 02:23
@alanmshelly
Copy link
Contributor

LGTM

@alanmshelly alanmshelly merged commit 6db6c8f into v1.1.0 Nov 17, 2017
@alanmshelly alanmshelly deleted the topic/recvonly branch November 17, 2017 02:42
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.

3 participants