Exoplayer: Is it possible disable Miracast?

Created on 27 Jan 2020  路  3Comments  路  Source: google/ExoPlayer

Is it possible to disable Miracast on Exoplayer when movie start to play?

question

All 3 comments

My understanding is that Miracast is an OS level feature, and I don't think there's an API that allows an individual app to disable it. It feels like to do so would be a confusing user experience. What is it that you're actually trying to achieve by doing that?

One of the requirements to send my product to the PlayStore is disable Miracast on Android devices this way the user can't cast the mobile screen to another device. I thought I could disable it exclusively on Exoplayer.

Whilst you can't disable Miracast, I think it should be possible for you to query whether it's enabled. You could then show a message to the user asking them to disconnect the external display rather than starting playback.

You can probably do this using DisplayManager.getDisplays, passing DisplayManager.DISPLAY_CATEGORY_PRESENTATION. Note that this will also include other types of presentation displays, such as connecting the mobile device to a TV via an HDMI adapter. I'm guessing that your requirement probably includes this kind of use case as well, so it's probably still what you want.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NatsumeReiko picture NatsumeReiko  路  62Comments

ojw28 picture ojw28  路  92Comments

sarahachem picture sarahachem  路  58Comments

priscila225 picture priscila225  路  40Comments

viacheslavokolitiy picture viacheslavokolitiy  路  179Comments