I made a fragment with following code:
class play_video : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_play_video)
val vidView = findViewById<VideoView>(R.id.videoView)
val vidController = MediaController(this)
val viduri = Uri.parse("android.resource://"+packageName+"/"+R.raw.test1)
vidView.setVideoURI(viduri)
vidView.start()
}
}
It shows the first frame of video and plays sound, but the video was not played and it only shows stopped image.
Is there anything I did wrong ?
The file name of the movie file is 'test1.MOV'
question from:
https://stackoverflow.com/questions/65899199/videoview-shows-only-stopped-movie 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…