title: Is There Have Solution To Load Video In Android? I Try To Load But Give Message Can't Play Video
body: <p>I have the following error:</p>
  <blockquote>
  <p>Can't play this video.</p>
  </blockquote>
  <p>as you can see in the image below:</p>
  <p><a href="https://i.stack.imgur.com/xi38G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xi38G.png" alt="enter image description here" /></a></p>
  <p>LoginAppActivity.java:</p>
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_login_app);
  
      emailInput = (EditText) findViewById(R.id.Email);
      passwordInput = (EditText) findViewById(R.id.Password);
      btnLogin = (Button) findViewById(R.id.buttonlogin);
      videoview = (VideoView) findViewById(R.id.bgVideo);
      String videoPath = &quot;android:resource//&quot;+getPackageName()+&quot;/&quot;+R.raw.bg3;
      String vidAddress = &quot;https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4&quot;;
      Uri vidUri = Uri.parse(vidAddress);
      Uri uri = Uri.parse(videoPath);
      videoview.setVideoURI(uri);
      videoview.requestFocus();
      videoview.start();
      videoview.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
          @Override
          public void onPrepared(MediaPlayer mp) {
              mp.setLooping(true);
          }
      });
  </code></pre>
  <p>this for activity login app xml
  activity_login_app.xml:</p>
  <pre><code> &lt;RelativeLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;VideoView
          android:id=&quot;@+id/bgVideo&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_alignParentBottom=&quot;true&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_gravity=&quot;center&quot;
          /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>