Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
85e5b838
Commit
85e5b838
authored
Mar 14, 2019
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a timer to call the updateJitsiTimeout
parent
f4a743d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
VideoConferencingPresenter.kt
...videoconferencing/presenter/VideoConferencingPresenter.kt
+11
-3
VideoConferencingActivity.kt
...android/videoconferencing/ui/VideoConferencingActivity.kt
+5
-0
No files found.
app/src/main/java/chat/rocket/android/videoconferencing/presenter/VideoConferencingPresenter.kt
View file @
85e5b838
...
@@ -11,7 +11,9 @@ import chat.rocket.core.internal.realtime.updateJitsiTimeout
...
@@ -11,7 +11,9 @@ import chat.rocket.core.internal.realtime.updateJitsiTimeout
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
import
java.util.*
import
javax.inject.Inject
import
javax.inject.Inject
import
kotlin.concurrent.timer
class
VideoConferencingPresenter
@Inject
constructor
(
class
VideoConferencingPresenter
@Inject
constructor
(
private
val
view
:
VideoConferencingView
,
private
val
view
:
VideoConferencingView
,
...
@@ -25,6 +27,7 @@ class VideoConferencingPresenter @Inject constructor(
...
@@ -25,6 +27,7 @@ class VideoConferencingPresenter @Inject constructor(
private
lateinit
var
client
:
RocketChatClient
private
lateinit
var
client
:
RocketChatClient
private
lateinit
var
publicSettings
:
PublicSettings
private
lateinit
var
publicSettings
:
PublicSettings
private
lateinit
var
chatRoomId
:
String
private
lateinit
var
chatRoomId
:
String
private
lateinit
var
timer
:
Timer
fun
setup
(
chatRoomId
:
String
)
{
fun
setup
(
chatRoomId
:
String
)
{
currentServerRepository
.
get
()
?.
let
{
currentServerRepository
.
get
()
?.
let
{
...
@@ -48,14 +51,19 @@ class VideoConferencingPresenter @Inject constructor(
...
@@ -48,14 +51,19 @@ class VideoConferencingPresenter @Inject constructor(
chatRoomId
chatRoomId
)
)
)
)
updateJitsiTimeout
()
}
}
client
.
updateJitsiTimeout
(
chatRoomId
)
}
}
}
}
// Jitsi update call needs to be called every 10 seconds to make sure call is not ended and is available to web users.
private
fun
updateJitsiTimeout
()
{
private
fun
updateJitsiTimeout
()
{
GlobalScope
.
launch
(
Dispatchers
.
IO
+
strategy
.
jobs
)
{
timer
=
timer
(
daemon
=
false
,
initialDelay
=
0L
,
period
=
10000
)
{
client
.
updateJitsiTimeout
(
chatRoomId
)
GlobalScope
.
launch
(
Dispatchers
.
IO
+
strategy
.
jobs
)
{
client
.
updateJitsiTimeout
(
chatRoomId
)
}
}
}
}
}
fun
invalidateTimer
()
=
timer
.
cancel
()
}
}
app/src/main/java/chat/rocket/android/videoconferencing/ui/VideoConferencingActivity.kt
View file @
85e5b838
...
@@ -32,5 +32,10 @@ class VideoConferencingActivity : JitsiMeetActivity(), VideoConferencingView {
...
@@ -32,5 +32,10 @@ class VideoConferencingActivity : JitsiMeetActivity(), VideoConferencingView {
presenter
.
setupVideoConferencing
()
presenter
.
setupVideoConferencing
()
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
presenter
.
invalidateTimer
()
}
override
fun
startVideoConferencing
(
url
:
URL
)
=
loadURL
(
url
)
override
fun
startVideoConferencing
(
url
:
URL
)
=
loadURL
(
url
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment