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

First version of SFU API #2

Merged
merged 49 commits into from
Jul 20, 2021
Merged

First version of SFU API #2

merged 49 commits into from
Jul 20, 2021

Conversation

mickel8
Copy link
Contributor

@mickel8 mickel8 commented Jul 1, 2021

No description provided.

@mickel8 mickel8 force-pushed the develop branch 3 times, most recently from f0deacf to 0cc228f Compare July 1, 2021 11:26
Eric Saxby and others added 2 commits July 9, 2021 13:28
Signed-off-by: Austin Putman <austinp@geometer.io>
Co-authored-by: Austin Putman <austinp@geometer.io>
@mickel8
Copy link
Contributor Author

mickel8 commented Jul 9, 2021

I made a quick commit of some grammar/typo fixes in the Elixir docs. Here it is for review:

geometerio@2b806eb

Awesome! Cherry-picked

Today we began playing with :deny_new_peer, and realized that we wanted to pass data through to the client. Here is our quick implementation: geometerio@51c10cc

Because we're mounting our page using LiveView, we could handle this entirely in our application with Phoenix.PubSub. I feel like this feature (passthrough of data to the onDenial javascript callback) would be useful for others, though.

Good idea, this also is something that @mat-hek proposed in #2 (comment). Cherry-picked

I am also wondering if data is meaningful enough. Could it be reason or there might be some cases in which we want more general name like data?

@mickel8 mickel8 force-pushed the develop branch 2 times, most recently from 872eca6 to c611020 Compare July 9, 2021 12:12
@mickel8 mickel8 requested a review from mat-hek July 13, 2021 15:18
Comment on lines 169 to 176
let mediaEvent = generateMediaEvent("join", {
relayAudio: relayAudio,
relayVideo: relayVideo,
receiveMedia: this.receiveMedia,
metadata: peerMetadata,
tracksMetadata: Array.from(this.localTrackIdToMetadata.values()),
});
this.callbacks.onSendMediaEvent(serializeMediaEvent(mediaEvent));
Copy link
Contributor

Choose a reason for hiding this comment

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

sendMediaEvent calling generateMediaEvent, serializeMediaEvent and onSendMediaEvent would be useful


/**
* Leaves the room. This function should be called when user leaves the room
* in a clean way e.g. by clicking dedicated, custom button `dissconnetc`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* in a clean way e.g. by clicking dedicated, custom button `dissconnetc`.
* in a clean way e.g. by clicking a dedicated, custom button `disconnect`.

Comment on lines 189 to 190
case event do
%{"type" => "leave"} ->
Copy link
Contributor

Choose a reason for hiding this comment

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

you already check that in the header

@@ -88,7 +105,7 @@ defmodule Membrane.SFU.MediaEvent do
end

defp do_deserialize(%{"type" => "join"} = event) do
Copy link
Contributor

Choose a reason for hiding this comment

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

There will be a match error on an unknown event. We'd probably add a fallback clause returning an error.

@@ -0,0 +1,13 @@
defmodule Membrane.SFUApp do
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
defmodule Membrane.SFUApp do
defmodule Membrane.SFU.App do

mix.exs Outdated

defp compile_ts(_) do
Mix.shell().info("Installing npm dependencies")
{result, exit_status} = System.cmd("npm", ["install"], cd: "assets")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should rather be npm ci

package.json Show resolved Hide resolved
@sax
Copy link
Contributor

sax commented Jul 18, 2021

In reference to :deny_new_peer:

I am also wondering if data is meaningful enough. Could it be reason or there might be some cases in which we want more general name like data?

We were torn on this. I think either way is valid. data is more extensible—one could provide a message for the user, as well as extra metadata such as where to redirect a client to. reason might make the API tighter, but force integrators to move more logic into javascript.

@mat-hek
Copy link
Contributor

mat-hek commented Jul 19, 2021

@sax @mickel8 maybe metadata is the proper word?

@mickel8 mickel8 requested a review from mat-hek July 19, 2021 12:09
@mickel8 mickel8 moved this from In progress to In Review in What's happening in Membrane? Jul 20, 2021
@mickel8 mickel8 merged commit 7365b84 into master Jul 20, 2021
What's happening in Membrane? automation moved this from In Review to Done Jul 20, 2021
@mickel8 mickel8 deleted the develop branch July 20, 2021 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants