title: How to play .mp4 video as a background video in Android?
body: <p>I have watched many tutorials but somethings wrong. I have simple mainactivity and there is a VideoView on the it's layout. I downloaded a video from youtube as a .mp4 file size is about 10 mb. I found a great sample about videoview on youtube as the following link.</p>
  
  <p><a href="https://www.youtube.com/watch?v=tPeDn18FrGY&amp;t=75s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=tPeDn18FrGY&amp;t=75s</a></p>
  
  <p>ublic class MainActivity extends AppCompatActivity {</p>
  
  <pre><code>private VideoView bgVideo;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          bgVideo=(VideoView) findViewById(R.id.bg_videoview);
  
          Uri uri = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.bgvideo);
  
          bgVideo.setVideoURI(uri);
          bgVideo.start();
  
          bgVideo.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
              @Override
              public void onPrepared(MediaPlayer mp) {
                  mp.setLooping(true);
              }
          });
      }
  }
  </code></pre>
  
  <p>I use genymotion emulator. While i run the app i take "can't play this" error. And at the android monitor things like this.</p>
  
  <pre><code>06-07 03:16:28.675 2146-2146/com.sample E/MediaPlayer: Error (1,-2147483648)
  06-07 03:16:28.675 2146-2146/com.sample D/VideoView: Error: 1,-2147483648
  06-07 03:16:28.692 2146-2146/com.sample E/MediaPlayer: Error (1,-2147483648)
  06-07 03:16:28.692 2146-2146/com.sample D/VideoView: Error: 1,-2147483648
  06-07 03:16:28.709 2146-2146/com.sample E/MediaPlayer: Error (1,-2147483648)
  06-07 03:16:28.709 2146-2146/com.sample D/VideoView: Error: 1,-2147483648
  06-07 03:16:28.742 2146-2146/com.sample E/MediaPlayer: Error (1,-32)
  06-07 03:16:28.742 2146-2146/com.sample D/VideoView: Error: 1,-32
  06-07 03:16:28.758 2146-2146/com.sample E/MediaPlayer: Error (1,-38)
  06-07 03:16:28.758 2146-2146/com.sample D/VideoView: Error: 1,-38
  06-07 03:16:29.526 2146-2146/com.sample I/Choreographer: Skipped 44 frames!  The application may be doing too much work on its main thread.
  </code></pre>
  
  <p>How can i fix it ?</p>