-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
Initial Support for Spacebar WebRTC #1108
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a tiny amount of work :)
if there isn't already, there should be a way to disable webrtc from loading, because I use windows for development, and I am not switching anytime soon. either config, or at the very least an environment variable |
Worst case you could use WSL I guess? |
Signed-off-by: Christopher Lentocha <[email protected]>
Signed-off-by: Christopher Lentocha <[email protected]>
Signed-off-by: Christopher Lentocha <[email protected]>
Signed-off-by: Christopher Lentocha <[email protected]>
Added but it needs testing directly on Windows, which I don't have, I have Linux. |
No. WSL Is NOT a option, WSL requires Hyper-v which is garbage in general,, slow, etc... WSL is more like emulation than a layer like WineHQ |
what? Wine is a stdlib overlay + bincompat layer, WSL is a full on vm (and it isnt slow either) |
Marked as ready since its possible to disable webrtc |
src/bundle/WinServer.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to include a separate file for windows, you could use dynamic imports or just, a top level if statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to include a separate file for windows, you could use dynamic imports or just, a top level if statement?
I tried, it doesn't seem to work out, because import is required to be used (const require doesn't seem to work) and needs to be at the top without an "if" statement. What I did in my last commit was the easiest and probably cleanest, and understandable by someone else.
You can just (if you want)
diff -aprNu src/bundle/Server.ts src/bundle/WinServer.ts
guild_id: voiceState.guild_id, | ||
user_id: this.user_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is incorrect. That parameter is used to determine the recipients of this gateway event. Your edit only sends the event to the user who left the channel, which means other users in the voice channel won't be updated.
@@ -84,7 +84,7 @@ export class VoiceState extends BaseClass { | |||
@Column({ nullable: true }) | |||
self_stream?: boolean; | |||
|
|||
@Column() | |||
@Column({ nullable: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be nullable, it should just be set to false by default. Regardless, you didn't write migrations for this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be nullable, it should just be set to false by default.
What do you mean by "false by default"?
Regardless, you didn't write migrations for this change.
Wasn't sure if I would keep the change but I will write mig's once the first question gets answered.
server: this.server, | ||
noServer: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rory&, this was done so that the websocket server would not be responsible for upgrading http connections, which is now done above with the uncommented update listener. This was done so that voice ws is mounted on /voice
I don't think this is necessary though, I would rather it just use a different port? This makes routing through nginx less difficult when using bundle.
Signed-off-by: Christopher Lentocha <[email protected]>
WSL 2 needs Hyper-v, the original WSL is to windows what wine is to linux |
honestly, hyper-v/WSL2 is completely fine, the slow part is the 9PFS mount for your windows drive |
I wonder if the original WSL will work or not with this? It should, and if it does, then users should use that to enable webrtc until a real native fix comes out. |
this hasn't had work for quite a while, there's a different WebRTC branch now that has a different blocker, and most of us don't know enough rust to fix it |
Ah, I see! Is there a reason this was re-done from scratch? |
not 100% sure tbh, I just want to see WebRTC working lol |
May I ask what on this PR isnt working exactly? |
not sure what is wrong with it, I'm not the person who deals with this stuff, I just make a client lol |
I just tried this now and it seems to work just fine on WSL at least for testing purposes for those who develop on Windows. Luckily VS Code makes it easy to develop on WSL. I don't know if anyone was ever planning to use Windows for production anyway. Issues I found:
I think a possible solution for that last bullet point is probably to make the webrtc server its own separate package which runs independently and communicates with the spacebar instance using RabbitMQ. This will mean that Spacebar will be webrtc-server implementation agnostic, and the end user can choose which implementation to pair with Spacebar. It will also mean that the webrtc server won't necessarily have to be a NodeJS server. |
May I ask what changes were exactly done?
I saw this is the same changes as the portion from 6beee77 thanks! I'll add it to the branch after I test it and fix the merge conflicts.
|
Unless you did this, this is my current guess:
|
I just did this
|
please note: WebRTC was ONLY tested using a test client that was since deleted by spacebar owners, no other clients were tested, nor bot libraries were either (discord.js didn't work for me since it always requires a https connection)
NOTE: This PR DOES NOT add Screen sharing, but adds webcam support and voice
BREAKING CHANGES: Windows can no longer be supported after this PR is merged, because medooze-media-server doesn't support windowsWebRTC can now be disabled with a env var to continue support for WindowsKnown bugs: