Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Refactor websockets and other membranewebrtc remains #70

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

graszka22
Copy link
Contributor

@graszka22 graszka22 commented Jun 19, 2024

Description

Refactor websockets and other membranewebrtc remains. So SDK will be fully related to fishjam server, not old membrane code

Motivation and Context

Code cleanup

How has this been tested?

Please describe in detail how you tested your changes. Include details of your
testing environment, devices (ex. Iphone XYZ ios X.X.X & Samsung XYZ android
X.X.X)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Screenshots (if appropriate)

@graszka22 graszka22 requested review from mironiasty and karkakol June 19, 2024 22:25
@@ -57,8 +57,11 @@ target 'FishjamExample' do
:mac_catalyst_enabled => false
)
end
pod 'FishjamClient', :git => 'https://github.com/fishjam-dev/ios-client-sdk.git', :commit => '9d22ecaf75cc563a24212c13e15cd83a3f76ac0f'
Copy link
Member

Choose a reason for hiding this comment

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

Before merging it should be changed to some semantic versioned version.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should figure out some better way to sync our three libraries together...

end



target 'ScreenBroadcast' do
Copy link
Member

Choose a reason for hiding this comment

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

same as above

self.sendEvent(eventName, data)
}

AsyncFunction("create") {
try membraneWebRTC.create()
AsyncFunction("connect") { (url: String, peerToken: String, promise: Promise ) in
Copy link
Member

Choose a reason for hiding this comment

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

why connect does not now take endpont metadata as an argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

old membrane webrtc was really a RTC Engine client so:

  • the user took care of connecting to the websocket (or something else - it's up to the user)
  • connect function took endpoint metadata and it was joining to the room
    Now that we have only fishjam client user no longer needs to care about websockets - we do it for them
    So:
  • the connect function connects to the websocket and authenticates so it takes url and peerToken
  • the joinRoom function is like the old connect function and joins the room with peer metadata

@@ -1,6 +1,6 @@
import {
useCamera,
useFishjamClient,
joinRoom as jsJoinRoom,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is isJoinRoom expected name here?

@@ -57,8 +57,11 @@ target 'FishjamExample' do
:mac_catalyst_enabled => false
)
end
pod 'FishjamClient', :git => 'https://github.com/fishjam-dev/ios-client-sdk.git', :commit => '9d22ecaf75cc563a24212c13e15cd83a3f76ac0f'
Copy link
Contributor

Choose a reason for hiding this comment

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

We should figure out some better way to sync our three libraries together...

try ensureConnected()
membraneRTC?.receiveMediaEvent(mediaEvent: data as SerializedMediaEvent)

func onSocketClose(code: UInt16, reason: String) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we still do not have swift-lint configured for this repo. But in meantime I think you can fix indentations here to match rest of file

Copy link
Contributor

@mironiasty mironiasty left a comment

Choose a reason for hiding this comment

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

Can you restore Podfile linking to avoid having linked specific commit?

target 'ScreenBroadcast' do
pod 'FishjamClient/Broadcast'
pod 'FishjamClient/Broadcast', :git => 'https://github.com/fishjam-dev/ios-client-sdk.git', :commit => '9d22ecaf75cc563a24212c13e15cd83a3f76ac0f'
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

@@ -1,6 +1,6 @@
import {
useCamera,
useFishjamClient,
joinRoom as fjJoinRoom,
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't like this name 😞 But I guess we have to leave it as it is for now, and maybe update example logic in future to avoid such case.
Maybe we can move useJoinRoom hook from example to library? 🤔

Copy link
Member

@karkakol karkakol left a comment

Choose a reason for hiding this comment

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

👍

@mironiasty mironiasty merged commit dc6908c into main Jun 25, 2024
3 checks passed
@mironiasty mironiasty deleted the chore/refactor_websockets branch June 25, 2024 09:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants