80.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
.
.
class MainActivity : AppCompatActivity() {
private var TAG = "VideoPlayer"
.
.
private fun configureVideoView() {
videoView1.setVideoURI(Uri.parse("android.resource://"
+ getPackageName() + "/"...