-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use SeekClickableArea component
* use SeekClickableArea component * create executeAfterTimeout method * add forward/rewind icons to PlayerIcons file Closes #15
- Loading branch information
Thalys Matias Carrara
committed
Jun 7, 2023
1 parent
3c4e1b7
commit 7dabe86
Showing
7 changed files
with
213 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...layer/src/main/java/com/profusion/androidenhancedvideoplayer/utils/ExecuteAfterTimeout.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.profusion.androidenhancedvideoplayer.utils | ||
|
||
import android.util.Log | ||
import kotlinx.coroutines.CancellationException | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Job | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
private val TAG = "EXECUTE_AFTER_TIMEOUT" | ||
|
||
fun executeAfterTimeout( | ||
scope: CoroutineScope, | ||
job: Job?, | ||
timeInMillis: Long = 650L, | ||
onJobComplete: () -> Unit | ||
): Job { | ||
job?.cancel() | ||
return scope.launch() { | ||
try { | ||
delay(timeInMillis) | ||
onJobComplete() | ||
} catch (e: CancellationException) { | ||
Log.i(TAG, e.stackTraceToString()) | ||
} | ||
} | ||
} |