Is it possible to disable Miracast on Exoplayer when movie start to play?
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.