title: Android: how to play mp4 video from URL?
body: <p>I'm trying to play video but having no luck so I'm testing with some bare bones code to see what the problem is. The following doesn't work and I'm not really sure why:</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.videotest"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="18" /&gt;
      &lt;uses-permission
      android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission
          android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.videotest.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>MainActivity:</p>
  
  <pre><code>public class MainActivity extends Activity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          VideoView vid = (VideoView) findViewById(R.id.videoView1);
          Uri vidUri = Uri.parse("http://somewebsite.com/somevideo.mp4");
          vid.setVideoURI(vidUri);
          vid.setMediaController(new MediaController(this));        
          vid.start();
       }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
  }
  </code></pre>
  
  <p>activity_main:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &gt;
  
      &lt;VideoView
          android:id="@+id/videoView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>This is the error I am given when running the code:</p>
  
  <pre><code>02-18 10:12:44.071: E/MediaPlayer(8357): java.io.FileNotFoundException: No content provider: http://somewebsite.com/somevideo.mp4
  </code></pre>