Search Unity

Question Disable Screen Capture Permission! (Media Projection API)

Discussion in 'Scripting' started by hikariakio, Jul 31, 2020.

  1. hikariakio

    hikariakio

    Joined:
    Dec 19, 2016
    Posts:
    25
    I want to disable the specific permission ( Screen Capture / Screenshot ) from android Media Projection API (like Netflix). I could not find it from Andriod.Permission. Do I need to define it in manifest or is there any other work around?

    And I also want to disable the screen capture just on certain scenes? Is that possible? or not disabling for the whole game is also enough.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    You'll have a lot more luck probably googling for this on the Android developer pages. There won't be any direct exposure of this in Unity, but you may be able to use some of the UnityEngine.Android namespace of functions to implement it yourself.
     
  3. hikariakio

    hikariakio

    Joined:
    Dec 19, 2016
    Posts:
    25
    What I think is I need to modify the manifest file manually. Let me research more and will update it.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Most likely it is a variation of this.

    Once you figure out what it is, you can make an Android-specific editor post-build step to always do it.

    Here is a bunch of interesting information regarding manipulating the AndroidManifest.xml file via Unity:

    https://docs.unity3d.com/Manual/android-manifest.html
     
    hikariakio likes this.
  5. FantiniMotionandStrategy

    FantiniMotionandStrategy

    Joined:
    Sep 3, 2021
    Posts:
    5
    Hi there! Are there any updates on disabling the screen capture on Android applications?