Skip to content

Commit

Permalink
Merge pull request #771 from QuickBlox/conference-kotlin
Browse files Browse the repository at this point in the history
1.1.0-conference-kotlin
  • Loading branch information
kirillTolmachev authored Nov 3, 2021
2 parents 478323c + 1de6683 commit 9178794
Show file tree
Hide file tree
Showing 22 changed files with 696 additions and 316 deletions.
13 changes: 6 additions & 7 deletions sample-conference-kotlin/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ android {
applicationId "com.quickblox.sample.conference.kotlin"
minSdkVersion 21
targetSdkVersion 30
versionCode 100000
versionName "1.0.0"
versionCode 110000
versionName "1.1.0"
multiDexEnabled true
}

Expand Down Expand Up @@ -110,19 +110,18 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersionKtx"
implementation "android.arch.lifecycle:extensions:$rootProject.lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-common-java8:$rootProject.lifecycleVersionKtx"
implementation "androidx.activity:activity-ktx:$rootProject.activityKtxVersion"
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentKtxVersion"

implementation "com.github.bumptech.glide:glide:$rootProject.glideVersion"

implementation "com.vmadalin:easypermissions-ktx:$rootProject.easyPermissionsVersion"
implementation "androidx.activity:activity-ktx:$rootProject.activityKtxVersion"
implementation "androidx.fragment:fragment-ktx:$rootProject.fragmentKtxVersion"

implementation "com.google.dagger:hilt-android:$hiltVersion"

implementation "com.google.android.gms:play-services-gcm:$rootProject.servicesGcmVersion"
implementation "com.google.firebase:firebase-core:$rootProject.firebaseCoreVersion"

kapt "com.google.dagger:hilt-compiler:$hiltVersion"
kapt "androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltAndroidXVersion"
kapt "androidx.hilt:hilt-compiler:$rootProject.hiltAndroidXVersion"
kapt "androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltViewmodel"
kapt "androidx.hilt:hilt-compiler:$rootProject.hiltCompiler"
}
2 changes: 1 addition & 1 deletion sample-conference-kotlin/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

<service
android:name=".data.service.CallService"
android:foregroundServiceType="mediaProjection"
android:foregroundServiceType="camera|microphone|mediaProjection"
android:launchMode="singleTask" />

<service android:name=".data.push.FcmPushListenerServiceImpl">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ private const val APPLICATION_ID = ""
private const val AUTH_KEY = ""
private const val AUTH_SECRET = ""
private const val ACCOUNT_KEY = ""
private const val JANUS_SERVER_URL = ""

// TODO Firebase keys in - google-services.json
private const val SERVER_URL = ""

/*
* Created by Injoit in 2021-09-30.
Expand Down Expand Up @@ -52,10 +50,10 @@ class App : Application() {
}

private fun initConferenceConfig() {
if (TextUtils.isEmpty(JANUS_SERVER_URL)) {
if (TextUtils.isEmpty(SERVER_URL)) {
throw AssertionError(getString(R.string.error_server_url_null))
} else {
ConferenceConfig.setUrl(JANUS_SERVER_URL)
ConferenceConfig.setUrl(SERVER_URL)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ import com.quickblox.videochat.webrtc.QBRTCTypes
class CallRepositoryImpl(private val context: Context) : CallRepository {
override fun createSession(userId: Int, callback: DataCallBack<ConferenceSession, Exception>) {
val conferenceType = QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
override fun onSuccess(session: ConferenceSession) {
Handler(Looper.getMainLooper()).post {
callback.onSuccess(session, null)
ConferenceClient.getInstance(context).createSession(userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
override fun onSuccess(session: ConferenceSession) {
Handler(Looper.getMainLooper()).post {
callback.onSuccess(session, null)
}
}
}

override fun onError(exception: WsException) {
Handler(Looper.getMainLooper()).post {
callback.onError(exception)
override fun onError(exception: WsException) {
Handler(Looper.getMainLooper()).post {
callback.onError(exception)
}
}
}
})
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ interface CallListener {
fun onError(exception: Exception)
fun releaseSession(exception: Exception?)
fun setOnlineParticipants(count: Int)
fun onClosedSession()
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.quickblox.conference.ConferenceSession
import com.quickblox.conference.QBConferenceRole
import com.quickblox.sample.conference.kotlin.domain.DomainCallback
import com.quickblox.sample.conference.kotlin.domain.call.entities.CallEntity
import com.quickblox.users.model.QBUser
import com.quickblox.sample.conference.kotlin.domain.call.entities.SessionState

/*
* Created by Injoit in 2021-09-30.
Expand All @@ -15,22 +15,27 @@ import com.quickblox.users.model.QBUser
interface CallManager {
fun getSession(): ConferenceSession?
fun getCurrentDialog(): QBChatDialog?
fun getCallEntities(): LinkedHashSet<CallEntity>
fun createSession(currentUser: QBUser, dialog: QBChatDialog, roomId: String, role: QBConferenceRole, callType: Int, callback: DomainCallback<ConferenceSession, Exception>)
fun getCallEntities(): Set<CallEntity>
fun createSession(currentUserId: Int, dialog: QBChatDialog?, roomId: String?, role: QBConferenceRole?,
callType: Int?, callback: DomainCallback<ConferenceSession, Exception>)
fun subscribeCallListener(callListener: CallListener)
fun unsubscribeCallListener(callListener: CallListener)
fun getRole(): QBConferenceRole?
fun getCallType(): Int?
fun swapCamera(callback: DomainCallback<Boolean?, Exception>)
fun swapCamera()
fun startSharing(permissionIntent: Intent)
fun stopSharing(callback: DomainCallback<Unit?, Exception>)
fun isSharing(): Boolean
fun isAudioEnabled(): Boolean?
fun isVideoEnabled(): Boolean?
fun isAudioEnabled(): Boolean
fun isVideoEnabled(): Boolean
fun isFrontCamera(): Boolean
fun setVideoEnabled(enable: Boolean)
fun setAudioEnabled(enable: Boolean)
fun leaveSession()
fun getEnableVideoState(): Boolean?
fun setEnableVideoState(enableState: Boolean?)
fun saveVideoState()
fun subscribeReconnectionListener(reconnectionListener: ReconnectionListener?)
fun unsubscribeReconnectionListener(reconnectionListener: ReconnectionListener?)
fun setDefaultReconnectionState()
fun getSessionState(): SessionState
fun setBackgroundState(backgroundState: Boolean)
}
Loading

0 comments on commit 9178794

Please sign in to comment.