


When the activity is destroyed, resources are released.Īpp/src/main/java/com/example/app/MainActivity.java package

When the activity is stopped, the media player is stopped too and the video layout is detached from the player. After that, an instance of the Media class is created and video begin to play. When the user selected a video file, the playVideo method is called. We attached the click listener to open a file browser when the button is clicked. For example, you can download the following video for testing: Make sure you have a video file in your mobile device. Also add the button for opening a file browser.Īpp/src/main/res/layout/activity_main.xml To display video, we should add a VLCVideoLayout in the layout XML file. This tutorial provides example how to play a video file using LibVLC on Android application.įirstly, add the LibVLC library as dependency in the module's adle file. VLC engine on Android application can be embedded using LibVLC library.
