70.8 Setting up the onPreparedListener
As a final example of working with video based media, the activity will now be extended further to demonstrate the mechanism for configuring a listener. In this case, a listener will be implemented that is intended to output the duration of the video as a message in the Android Studio Logcat panel. The listener will also configure video playback to loop continuously:
package com.ebookfrenzy.videoplayer;
.
.
import android.util.Log;
import android.media.MediaPlayer;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
private VideoView videoView;
private MediaController mediaController;
String TAG = "VideoPlayer";
private void configureVideoView() {
binding...