Merge pull request 'Fixes bug where canceling cast dialog would lockout cast button' (#4) from bug_fix_cast_button into main
Reviewed-on: http://192.168.1.74:30008/kfj001/kryz-go-flutter/pulls/4
This commit was merged in pull request #4.
This commit is contained in:
@@ -186,6 +186,9 @@ class MainActivity : AudioServiceActivity(), MethodChannel.MethodCallHandler, Ev
|
||||
chooserDialog = MediaRouteChooserDialog(themedContext)
|
||||
chooserDialog?.routeSelector = routeSelector
|
||||
chooserDialog?.setCanceledOnTouchOutside(true)
|
||||
chooserDialog?.setOnDismissListener {
|
||||
handlePickerDismissed()
|
||||
}
|
||||
chooserDialog?.show()
|
||||
|
||||
emitStatus("connecting")
|
||||
@@ -194,6 +197,17 @@ class MainActivity : AudioServiceActivity(), MethodChannel.MethodCallHandler, Ev
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePickerDismissed() {
|
||||
chooserDialog = null
|
||||
|
||||
val currentSession = castContext?.sessionManager?.currentCastSession
|
||||
val currentStatus = statusPayload["status"] as? String
|
||||
|
||||
if (currentSession == null && currentStatus == "connecting") {
|
||||
emitStatus("idle")
|
||||
}
|
||||
}
|
||||
|
||||
private fun startCastingLiveStream(call: MethodCall, result: MethodChannel.Result) {
|
||||
val arguments = call.arguments as? Map<*, *>
|
||||
if (arguments == null) {
|
||||
|
||||
Reference in New Issue
Block a user