Skip to content

Commit

Permalink
Merge pull request #116 from GetStream/refactor/video-initializer
Browse files Browse the repository at this point in the history
Remove useless coroutine scopes
  • Loading branch information
skydoves committed Oct 27, 2023
2 parents 9534335 + 49d330f commit 68b15c0
Showing 1 changed file with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,23 @@ import io.getstream.video.android.core.StreamVideoBuilder
import io.getstream.video.android.model.User
import io.getstream.whatsappclone.video.BuildConfig
import java.nio.charset.StandardCharsets
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

class StreamVideoInitializer : Initializer<Unit> {

override fun create(context: Context) {
val userId = "stream"
val coroutineScope = CoroutineScope(Dispatchers.IO)
coroutineScope.launch {
// initialize Stream Video SDK
StreamVideoBuilder(
context = context,
apiKey = BuildConfig.STREAM_API_KEY,
token = devToken(userId),
user = User(
id = userId,
name = "stream",
image = "http://placekitten.com/200/300",
role = "admin"
)
).build()
}
// initialize Stream Video SDK
StreamVideoBuilder(
context = context,
apiKey = BuildConfig.STREAM_API_KEY,
token = devToken(userId),
user = User(
id = userId,
name = "stream",
image = "http://placekitten.com/200/300",
role = "admin"
)
).build()
}

override fun dependencies(): List<Class<out Initializer<*>>> = emptyList()
Expand Down

0 comments on commit 68b15c0

Please sign in to comment.