I have an app that contains a video on loop which is longer than the length of the screen, however it is not possible to scroll down and see the bottom section of the video (located outside the bottom end of the screen).
How can I allow the video to be scrolled up and down?
activity_main.xml:
< LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
android: orientation = "vertical"
android: layout_width = "match_parent"
android: layout_height = "match_parent" >
<
VideoView
android: layout_width = "wrap_content"
android: layout_height = "2950px"
android: id = "@+id/dig_lic" /
>
<
/LinearLayout>
MainActivity.kt:
class MainActivity: ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle ? ) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val videoView = findViewById < VideoView > (R.id.dig_lic)
val packageName = "android.resource://" + getPackageName() + "/" + R.raw.dig_lic_video
val uri = Uri.parse(packageName)
videoView.setOnPreparedListener {
it.isLooping = true
}
videoView.setVideoURI(uri)
videoView.start()
}
}