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

Commit

Permalink
Update project configuration to remove Jellyfish references (#20)
Browse files Browse the repository at this point in the history
Update all references in code to only use Fishjam. This include names in
code, project names, build variables.
I also updated `protos`, README and few other small things
  • Loading branch information
mironiasty authored May 27, 2024
1 parent 352d0cf commit 9bacc5c
Show file tree
Hide file tree
Showing 35 changed files with 211 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
run: swift package update Mockingbird && ./gen-mocks.sh

- name: Run tests 💀
run: set -o pipefail && xcodebuild -scheme JellyfishClientSdkTests test -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcbeautify
run: set -o pipefail && xcodebuild -scheme FishjamClientTests test -destination "platform=iOS Simulator,name=iPhone 14,OS=latest" | xcbeautify
2 changes: 1 addition & 1 deletion .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3

- name: Build Docs
run: mkdir docs && xcodebuild docbuild -scheme JellyfishClientSdk -destination generic/platform=iOS OTHER_DOCC_FLAGS="--transform-for-static-hosting --output-path docs --hosting-base-path ios-client-sdk"
run: mkdir docs && xcodebuild docbuild -scheme FishjamClient -destination generic/platform=iOS OTHER_DOCC_FLAGS="--transform-for-static-hosting --output-path docs --hosting-base-path ios-client-sdk"

- name: Install coreutils
run: brew install coreutils
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ iOSInjectionProject/

node_modules

JellyfishClientDemo/Debug.xcconfig
FishjamClientDemo/Debug.xcconfig

# Generated
*.generated.swift
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "protos"]
path = protos
url = https://github.com/jellyfish-dev/protos.git
url = https://github.com/fishjam-dev/protos.git

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2FB8B3CD2A20C6DA0060E251"
BuildableName = "JellyfishClientDemo.app"
BlueprintName = "JellyfishClientDemo"
ReferencedContainer = "container:JellyfishClientDemo.xcodeproj">
BuildableName = "FishjamClientDemo.app"
BlueprintName = "FishjamClientDemo"
ReferencedContainer = "container:FishjamClientDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -35,9 +35,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2FB8B3DD2A20C6DD0060E251"
BuildableName = "JellyfishClientDemoTests.xctest"
BlueprintName = "JellyfishClientDemoTests"
ReferencedContainer = "container:JellyfishClientDemo.xcodeproj">
BuildableName = "FishjamClientDemoTests.xctest"
BlueprintName = "FishjamClientDemoTests"
ReferencedContainer = "container:FishjamClientDemo.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
Expand All @@ -46,9 +46,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2FB8B3E72A20C6DD0060E251"
BuildableName = "JellyfishClientDemoUITests.xctest"
BlueprintName = "JellyfishClientDemoUITests"
ReferencedContainer = "container:JellyfishClientDemo.xcodeproj">
BuildableName = "FishjamClientDemoUITests.xctest"
BlueprintName = "FishjamClientDemoUITests"
ReferencedContainer = "container:FishjamClientDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
Expand All @@ -68,9 +68,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2FB8B3CD2A20C6DA0060E251"
BuildableName = "JellyfishClientDemo.app"
BlueprintName = "JellyfishClientDemo"
ReferencedContainer = "container:JellyfishClientDemo.xcodeproj">
BuildableName = "FishjamClientDemo.app"
BlueprintName = "FishjamClientDemo"
ReferencedContainer = "container:FishjamClientDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -85,9 +85,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2FB8B3CD2A20C6DA0060E251"
BuildableName = "JellyfishClientDemo.app"
BlueprintName = "JellyfishClientDemo"
ReferencedContainer = "container:JellyfishClientDemo.xcodeproj">
BuildableName = "FishjamClientDemo.app"
BlueprintName = "FishjamClientDemo"
ReferencedContainer = "container:FishjamClientDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// ContentView.swift
// JellyfishClientDemo
// FishjamClientDemo
//
// Created by Karol Sygiet on 26/05/2023.
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// ContentViewController.swift
// JellyfishClientDemo
// FishjamClientDemo
//
// Created by Karol Sygiet on 02/06/2023.
//

import FishjamClient
import Foundation
import JellyfishClientSdk
import UIKit

struct Participant {
Expand Down Expand Up @@ -39,7 +39,7 @@ class ParticipantVideo: Identifiable, ObservableObject {
}

class ContentViewController: ObservableObject {
private var jellyfishClient: JellyfishClientSdk?
private var fishjamClient: FishjamClient?

@Published var participants: [String: Participant]
@Published var participantVideos: [ParticipantVideo]
Expand All @@ -57,12 +57,12 @@ class ContentViewController: ObservableObject {
self.localParticipantId = "local"
self.connected = false

self.jellyfishClient = JellyfishClientSdk(listener: self)
self.fishjamClient = FishjamClient(listener: self)
}

public func connect(peerToken: String) {
let conf = Config(
websocketUrl: (Bundle.main.infoDictionary?["jellyfish_url"] as! String),
websocketUrl: (Bundle.main.infoDictionary?["fishjam_url"] as! String),
token: peerToken
)

Expand All @@ -81,20 +81,20 @@ class ContentViewController: ObservableObject {
simulcastConfig: SimulcastConfig(enabled: false)
)

jellyfishClient?.connect(config: conf)
fishjamClient?.connect(config: conf)

self.localVideoTrack = jellyfishClient?.createVideoTrack(
self.localVideoTrack = fishjamClient?.createVideoTrack(
videoParameters: videoParameters, metadata: .init(videoTrackMetadata))
self.localAudioTrack = jellyfishClient?.createAudioTrack(metadata: .init(audioTrackMetadata))
self.localAudioTrack = fishjamClient?.createAudioTrack(metadata: .init(audioTrackMetadata))

}

public func disconnect() {
jellyfishClient?.cleanUp()
fishjamClient?.cleanUp()
}
}

extension ContentViewController: JellyfishClientListener {
extension ContentViewController: FishjamClientListener {
func onBandwidthEstimationChanged(estimation: Int) {

}
Expand Down Expand Up @@ -267,7 +267,7 @@ extension ContentViewController: JellyfishClientListener {
}

func onAuthSuccess() {
jellyfishClient?.join(peerMetadata: .init(["displayName": "iphoneUser"]))
fishjamClient?.join(peerMetadata: .init(["displayName": "iphoneUser"]))
}

func onAuthError() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// JellyfishClientDemoApp.swift
// JellyfishClientDemo
// FishjamClientDemoApp.swift
// FishjamClientDemo
//
// Created by Karol Sygiet on 26/05/2023.
//

import SwiftUI

@main
struct JellyfishClientDemoApp: App {
struct FishjamClientDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>jellyfish_url</key>
<string>$(jellyfish_url)</string>
<key>fishjam_url</key>
<string>$(fishjam_url)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import JellyfishClientSdk
import FishjamClient
import SwiftUI

struct ParticipantVideoView: View {
Expand Down
1 change: 1 addition & 0 deletions FishjamClientDemo/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fishjam_url = ws:/$()/192.168.0.164:4000/socket/peer/websocket
1 change: 0 additions & 1 deletion JellyfishClientDemo/Release.xcconfig

This file was deleted.

10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import PackageDescription

let package = Package(
name: "JellyfishClientSdk",
name: "FishjamClient",
platforms: [
.iOS(.v13)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "JellyfishClientSdk",
targets: ["JellyfishClientSdk"])
name: "FishjamClient",
targets: ["FishjamClient"])
],
dependencies: [
.package(name: "WebRTC", url: "https://github.com/webrtc-sdk/Specs.git", .exact("114.5735.08")),
Expand All @@ -37,14 +37,14 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "JellyfishClientSdk",
name: "FishjamClient",
dependencies: [
"WebRTC", "SwiftProtobuf", "Promises", "SwiftPhoenixClient",
.product(name: "Starscream", package: "Starscream"),
.product(name: "FBLPromises", package: "Promises"),
.product(name: "Logging", package: "swift-log"),
],
path: "Sources"),
.testTarget(name: "JellyfishClientSdkTests", dependencies: ["JellyfishClientSdk", "Mockingbird"]),
.testTarget(name: "FishjamClientTests", dependencies: ["FishjamClient", "Mockingbird"]),
]
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

The repository consists of 3 separate components:

- `JellyfishClientSdk` - Fishjam client fully compatible with `Fishjam`, responsible for exchanging media events and
- `FishjamClient` - Fishjam client fully compatible with `Fishjam`, responsible for exchanging media events and
receiving media streams which then are presented to the user
- `JellyfishCLientDemo` - Demo application utilizing `Fishjam` client
- `FishjamClientDemo` - Demo application utilizing `Fishjam` client
- `MembraneRTC` - iOS WebRTC client

### Example App
Expand All @@ -24,7 +24,7 @@ API documentation is available [here](https://fishjam-dev.github.io/ios-client-s

## Installation

Add FishjamClientSDK dependency to your project.
Add FishjamClient dependency to your project.

## Developing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public struct Config {
}
}

internal protocol JellyfishWebsocket {
internal protocol FishjamWebsocket {
var delegate: WebSocketDelegate? { get set }
func connect()
func disconnect()
func write(data: Data)
}

public class JellyfishClientWebSocket: JellyfishWebsocket {
public class FishjamClientWebSocket: FishjamWebsocket {
var socket: WebSocket
var delegate: WebSocketDelegate? {
set { self.socket.delegate = newValue }
Expand All @@ -42,18 +42,18 @@ public class JellyfishClientWebSocket: JellyfishWebsocket {
}
}

internal func websocketFactory(url: String) -> JellyfishWebsocket {
internal func websocketFactory(url: String) -> FishjamWebsocket {
let url = URL(string: url)
let urlRequest = URLRequest(url: url!)
return JellyfishClientWebSocket(socket: WebSocket(request: urlRequest))
return FishjamClientWebSocket(socket: WebSocket(request: urlRequest))
}

public class JellyfishClientSdk {
private var client: JellyfishClientInternal
public class FishjamClient {
private var client: FishjamClientInternal
private var webrtcClient: MembraneRTC

public init(listener: JellyfishClientListener) {
self.client = JellyfishClientInternal(listener: listener, websocketFactory: websocketFactory)
public init(listener: FishjamClientListener) {
self.client = FishjamClientInternal(listener: listener, websocketFactory: websocketFactory)
self.webrtcClient = MembraneRTC.create(delegate: self.client)
self.client.webrtcClient = self.webrtcClient
}
Expand Down Expand Up @@ -85,8 +85,8 @@ public class JellyfishClientSdk {
}

/**
* Tries to join the room. If user is accepted then {@link JellyfishClient.onJoinSuccess} will be called.
* In other case {@link JellyfishClient.onJoinError} is invoked.
* Tries to join the room. If user is accepted then {@link FishjamClient.onJoinSuccess} will be called.
* In other case {@link FishjamClient.onJoinError} is invoked.
*
* @param peerMetadata - Any information that other peers will receive in onPeerJoined
* after accepting this peer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Foundation
import Starscream

internal class JellyfishClientInternal: MembraneRTCDelegate, WebSocketDelegate {
internal class FishjamClientInternal: MembraneRTCDelegate, WebSocketDelegate {
private var config: Config?
private var webSocket: JellyfishWebsocket?
private var listener: JellyfishClientListener
private var websocketFactory: (String) -> JellyfishWebsocket
var webrtcClient: JellyfishMembraneRTC?
private var webSocket: FishjamWebsocket?
private var listener: FishjamClientListener
private var websocketFactory: (String) -> FishjamWebsocket
var webrtcClient: FishjamMembraneRTC?

public init(listener: JellyfishClientListener, websocketFactory: @escaping (String) -> JellyfishWebsocket) {
public init(listener: FishjamClientListener, websocketFactory: @escaping (String) -> FishjamWebsocket) {
self.listener = listener
self.websocketFactory = websocketFactory
}
Expand Down Expand Up @@ -61,8 +61,8 @@ internal class JellyfishClientInternal: MembraneRTCDelegate, WebSocketDelegate {

func websocketDidConnect() {
onSocketOpen()
let authRequest = Jellyfish_PeerMessage.with({
$0.authRequest = Jellyfish_PeerMessage.AuthRequest.with({
let authRequest = Fishjam_PeerMessage.with({
$0.authRequest = Fishjam_PeerMessage.AuthRequest.with({
$0.token = self.config?.token ?? ""
})
})
Expand All @@ -75,7 +75,7 @@ internal class JellyfishClientInternal: MembraneRTCDelegate, WebSocketDelegate {

func websocketDidReceiveData(data: Data) {
do {
let peerMessage = try Jellyfish_PeerMessage(serializedData: data)
let peerMessage = try Fishjam_PeerMessage(serializedData: data)
if case .authenticated(_) = peerMessage.content {
onAuthSuccess()
} else if case .mediaEvent(_) = peerMessage.content {
Expand Down Expand Up @@ -115,8 +115,8 @@ internal class JellyfishClientInternal: MembraneRTCDelegate, WebSocketDelegate {

func onSendMediaEvent(event: SerializedMediaEvent) {
let mediaEvent =
Jellyfish_PeerMessage.with({
$0.mediaEvent = Jellyfish_PeerMessage.MediaEvent.with({
Fishjam_PeerMessage.with({
$0.mediaEvent = Fishjam_PeerMessage.MediaEvent.with({
$0.data = event
})
})
Expand Down
Loading

0 comments on commit 9bacc5c

Please sign in to comment.