Commit 0d3958d5 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Displaymanager: Fix logic fail

parent cb509f79
......@@ -122,11 +122,11 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
mediaRouterCallback = object : MediaRouter.SimpleCallback() {
override fun onRoutePresentationDisplayChanged(
router: MediaRouter, info: MediaRouter.RouteInfo) {
if (BuildConfig.DEBUG) Log.d(TAG, "onRoutePresentationDisplayChanged: info=" + info)
if (BuildConfig.DEBUG) Log.d(TAG, "onRoutePresentationDisplayChanged: info=$info")
val newDisplayId = info.presentationDisplay?.displayId ?: -1
if (newDisplayId == presentationDisplayId) return
presentationDisplayId = newDisplayId
if (presentationDisplayId != -1) removePresentation() else updateDisplayType()
if (newDisplayId == -1) removePresentation() else updateDisplayType()
}
}
mediaRouter?.addCallback(MediaRouter.ROUTE_TYPE_LIVE_VIDEO, mediaRouterCallback)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment