diff --git a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/fcast/FcastAction.kt b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/fcast/FcastAction.kt index f69da0e059..458d1dc997 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/actions/temp/fcast/FcastAction.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/actions/temp/fcast/FcastAction.kt @@ -34,14 +34,16 @@ class FcastAction: VideoClickAction() { ) { val link = result.links.getOrNull(index ?: 0) ?: return val devices = FcastManager.currentDevices.toList() - context?.getActivity()?.showBottomDialog( - devices.map { it.name }, - -1, - txt(R.string.player_settings_select_cast_device).asString(context), - false, - {}) { - val position = getViewPos(video.id)?.position - castTo(devices.getOrNull(it), link, position) + uiThread { + context?.getActivity()?.showBottomDialog( + devices.map { it.name }, + -1, + txt(R.string.player_settings_select_cast_device).asString(context), + false, + {}) { + val position = getViewPos(video.id)?.position + castTo(devices.getOrNull(it), link, position) + } } }