Video failed

I have an application that automatically starts the video when you open the application, it was in the previous order, but when I add an audio file to the next operation. When I turn it on, it becomes an application crash. Note. Operating System: Android 5.1.1 Put me a solution, please. My video code.

                                                                                  
 public void splashPlayer() {                                                     
  VideoView videoView = (VideoView)findViewById(R.id.videoView1);                 
  Uri video = Uri.parse("android.resource://" + getPackageName() + "/"            
          + R.raw.firstopenvideo);                                                
  videoView.setVideoURI(video);                                                   
  videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {      
      public void onCompletion(MediaPlayer mp) {                                  
      }                                                                           
  });                                                                             
  videoView.start();                                                              
 }                                                                                
Run codeHide result
+4
source share

Source: https://habr.com/ru/post/1620180/


All Articles