Skip to content

Commit cd91c20

Browse files
committed
Add force stop on long click
1 parent 2b15c90 commit cd91c20

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/github/kairusds/libvlcandroidtest/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ protected void onCreate(Bundle savedInstanceState){
8484
showFilePickerDialog(Environment.getExternalStorageDirectory());
8585
}
8686
});
87+
videoLayout.setOnLongClickListener(v -> {
88+
if(libVLCAvailable()){
89+
destroyVLC();
90+
}
91+
});
8792

8893
checkPermissions();
8994
}
@@ -110,6 +115,7 @@ private void initVLC(){
110115

111116
private void destroyVLC(){
112117
if(!libVLCAvailable()) return;
118+
time = 0L;
113119
mediaPlayer.stop();
114120
mediaPlayer.detachViews();
115121
mediaPlayer.release();

0 commit comments

Comments
 (0)