Closed enzocandotti closed 4 years ago
I could do it modifying VideoPlayer.java, and adding this lines:
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.MotionEvent;
//(line 143)
videoView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.d(LOG_TAG, "Touch while playing");
player.stop();
player.release();
dialog.dismiss();
return true;
}
});
I'm using this plugin to play a video as a screensaver, so the idea is to stop the video by touching anywhere.
I know you implemented the close() method, but I can't call it whenever I want while the video is playing, because it opens on fullscreen, and I can't add a button or something like this.
Maybe I'm ignoring something, if you can think in a way to do it, I'd be grateful.