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

rename project source files from jellyfish to fishjam #18

Merged
merged 10 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
run: ./gradlew assembleRelease

- name: Test
run: ./gradlew :JellyfishClient:testDebugUnitTest
run: ./gradlew :FishjamClient:testDebugUnitTest
2 changes: 1 addition & 1 deletion .github/workflows/publish_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
env:
REPO: self
BRANCH: gh-pages
FOLDER: JellyfishClient/build/dokka/html
FOLDER: FishjamClient/build/dokka/html
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 = [email protected]:jellyfish-dev/protos.git
url = [email protected]:fishjam-dev/protos.git
File renamed without changes.
14 changes: 7 additions & 7 deletions JellyfishClient/build.gradle → FishjamClient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id "org.jetbrains.dokka"
id "com.google.protobuf" version "0.9.3"
id "com.google.protobuf" version "0.9.4"
id 'maven-publish'

id "kotlin-android"
}

android {
namespace 'com.jellyfishdev.jellyfishclient'
namespace 'com.fishjamdev.client'
compileSdk 33

defaultConfig {
Expand Down Expand Up @@ -45,8 +45,8 @@ afterEvaluate {
// Creates a Maven publication called "release".
release(MavenPublication) {
from components.release
groupId = 'com.jellyfishdev.jellyfishclient'
artifactId = 'jellyfish-android-client'
groupId = 'com.fishjamdev.client'
artifactId = 'fishjam-android-client'
version = '0.1.0'
}
}
Expand All @@ -61,7 +61,7 @@ afterEvaluate {
}

tasks.named("dokkaHtml") {
moduleName.set("JellyfishClient")
moduleName.set("FishjamClient")
dokkaSourceSets {
named("main") {
includes.from("module.md")
Expand All @@ -84,7 +84,7 @@ dependencies {
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'com.google.protobuf:protobuf-kotlin:3.23.1'
implementation 'com.google.protobuf:protobuf-kotlin:4.26.1'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

Expand All @@ -103,4 +103,4 @@ dependencies {
testImplementation "io.mockk:mockk:1.13.2"
testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1'

}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jellyfishdev.jellyfishclient
package com.fishjamdev.client

import android.content.Context
import android.content.Intent
Expand All @@ -12,15 +12,15 @@ import org.membraneframework.rtc.models.RTCStats
import org.membraneframework.rtc.utils.Metadata
import org.webrtc.Logging

typealias TrackContext = JellyfishTrackContext
typealias TrackContext = FishjamTrackContext

data class Config(
val websocketUrl: String,
val token: String
)

class JellyfishClient(appContext: Context, listener: JellyfishClientListener) {
private val client = JellyfishClientInternal(appContext, listener)
class FishjamClient(appContext: Context, listener: FishjamClientListener) {
private val client = FishjamClientInternal(appContext, listener)

/**
* Connects to the server using the WebSocket connection
Expand All @@ -41,8 +41,8 @@ class JellyfishClient(appContext: Context, listener: JellyfishClientListener) {
}

/**
* Tries to join the room. If user is accepted then {@link JellyfishClient.onConnected} will be called.
* In other case {@link JellyfishClient.onConnectError} is invoked.
* Tries to join the room. If user is accepted then {@link FishjamClient.onConnected} will be called.
* In other case {@link FishjamClient.onConnectError} 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,8 +1,7 @@
package com.jellyfishdev.jellyfishclient
package com.fishjamdev.client

import android.content.Context
import jellyfish.PeerNotifications.PeerMessage
import jellyfish.PeerNotifications.PeerMessage.MediaEvent
import fishjam.PeerNotifications.PeerMessage
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
Expand All @@ -20,9 +19,9 @@ import timber.log.Timber

typealias Peer = Endpoint

internal class JellyfishClientInternal(
internal class FishjamClientInternal(
appContext: Context,
private val listener: JellyfishClientListener
private val listener: FishjamClientListener
) :
MembraneRTCListener {
private var webSocket: WebSocket? = null
Expand Down Expand Up @@ -127,7 +126,7 @@ internal class JellyfishClientInternal(
val mediaEvent =
PeerMessage
.newBuilder()
.setMediaEvent(MediaEvent.newBuilder().setData(event))
.setMediaEvent(PeerMessage.MediaEvent.newBuilder().setData(event))
.build()
sendEvent(mediaEvent)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.jellyfishdev.jellyfishclient
package com.fishjamdev.client

import okhttp3.Response
import timber.log.Timber

interface JellyfishClientListener {
interface FishjamClientListener {
/**
* Emitted when the websocket connection is closed
*/
Expand Down Expand Up @@ -42,15 +42,15 @@ interface JellyfishClientListener {
fun onAuthError()

/**
* Emitted when local user is connected to jellyfish.
* Emitted when local user is connected to fishjam.
*/
fun onJoined(
peerID: String,
peersInRoom: List<Peer>
)

/**
* Emitted when there was an error while connecting to the jellyfish.
* Emitted when there was an error while connecting to the fishjam.
*/
fun onJoinError(metadata: Any)

Expand Down Expand Up @@ -79,14 +79,14 @@ interface JellyfishClientListener {
/**
* Called when data in a new track arrives.
*
* This callback is always called after {@link JellyfishClientListener.onTrackAdded}.
* This callback is always called after {@link FishjamClientListener.onTrackAdded}.
* It informs user that data related to the given track arrives and can be played or displayed.
*/
fun onTrackReady(ctx: TrackContext)

/**
* Called each time the peer which was already in the room, adds new track. Fields track and stream will be set to null.
* These fields will be set to non-null value in {@link JellyfishClientListener.onTrackReady}
* These fields will be set to non-null value in {@link FishjamClientListener.onTrackReady}
*/
fun onTrackAdded(ctx: TrackContext) {
Timber.i("Track ${ctx.trackId} added")
Expand All @@ -95,7 +95,7 @@ interface JellyfishClientListener {
/**
* Called when some track will no longer be sent.
*
* It will also be called before {@link JellyfishClientListener.onPeerLeft} for each track of this peer.
* It will also be called before {@link FishjamClientListener.onPeerLeft} for each track of this peer.
*/
fun onTrackRemoved(ctx: TrackContext)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.jellyfishdev.jellyfishclient
package com.fishjamdev.client

import org.membraneframework.rtc.TrackEncoding
import org.membraneframework.rtc.media.RemoteTrack
Expand All @@ -9,15 +9,15 @@ import org.membraneframework.rtc.models.TrackContext
import org.membraneframework.rtc.models.VadStatus
import org.membraneframework.rtc.utils.Metadata

fun interface JellyfishOnVoiceActivityChangedListener {
fun onVoiceActivityChanged(trackContext: JellyfishTrackContext)
fun interface FishjamOnVoiceActivityChangedListener {
fun onVoiceActivityChanged(trackContext: FishjamTrackContext)
}

fun interface JellyfishOnEncodingChangedListener {
fun onEncodingChangedListener(trackContext: JellyfishTrackContext)
fun interface FishjamOnEncodingChangedListener {
fun onEncodingChangedListener(trackContext: FishjamTrackContext)
}

class JellyfishTrackContext(private val trackContext: TrackContext) {
class FishjamTrackContext(private val trackContext: TrackContext) {
val track: RemoteTrack?
get() {
return trackContext.track
Expand Down Expand Up @@ -53,20 +53,20 @@ class JellyfishTrackContext(private val trackContext: TrackContext) {
return trackContext.encodingReason
}

fun setOnEncodingChangedListener(listener: JellyfishOnEncodingChangedListener) {
fun setOnEncodingChangedListener(listener: FishjamOnEncodingChangedListener) {
val rtcListener =
OnEncodingChangedListener {
trackContext ->
listener.onEncodingChangedListener(JellyfishTrackContext(trackContext))
listener.onEncodingChangedListener(FishjamTrackContext(trackContext))
}
trackContext.setOnEncodingChangedListener(rtcListener)
}

fun setOnVoiceActivityChangedListener(listener: JellyfishOnVoiceActivityChangedListener) {
fun setOnVoiceActivityChangedListener(listener: FishjamOnVoiceActivityChangedListener) {
val rtcListener =
OnVoiceActivityChangedListener {
trackContext ->
listener.onVoiceActivityChanged(JellyfishTrackContext(trackContext))
listener.onVoiceActivityChanged(FishjamTrackContext(trackContext))
}
trackContext.setOnVoiceActivityChangedListener(rtcListener)
}
Expand Down
Loading
Loading