Block video recording during execution of flutter app

Issue

I have a flutter application which uses youtube_player_flutter: ^7.0.0+7 to play YouTube videos. This is an educational app and I don’t want anyone to record my video lectures through any screen recorder. Is there anything I can do to block users recording my videos? Any kind of help is much appreciated. Thank you!

Solution

You have to add the FLAG_SECURE which will prevent the screenshot and video recording.

 await FlutterWindowManager.addFlags(FlutterWindowManager.FLAG_SECURE);

This an example of how to disable Screenshot and Video Capture and also see this video.

Also, if you face a problem and if it is not working in the current version, I will recommend you to read the discussion on GitHub about the FLAG_SECURE don’t work on Flutter application

Answered By – I_Al-thamary

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *