Adds note to make sure we know the callback of a prepare video runs in the main thread.

This commit is contained in:
Vitor Pamplona 2023-09-26 10:56:28 -04:00
parent e3df94338f
commit 1387a0f62b

View File

@ -299,6 +299,8 @@ fun GetVideoController(
nostrUriCallback,
context
) {
// REQUIRED TO BE RUN IN THE MAIN THREAD
// checks again because of race conditions.
if (controller.value == null) { // still prone to race conditions.
controller.value = it
@ -382,6 +384,8 @@ fun GetVideoController(
nostrUriCallback,
context
) {
// REQUIRED TO BE RUN IN THE MAIN THREAD
// checks again to make sure no other thread has created a controller.
if (controller.value == null) {
controller.value = it