Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display Video in the Android Emulator from Remote URL?
    text
    copied!<p>I am using the following code to display a video file in the android emulator,it works fine when the video file is stored in a SDcard.But when i give any URL of a video the code not working.</p> <pre><code>import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.View; import android.widget.*; public class playerActivity extends Activity { Button b; VideoView preview; SurfaceHolder holder; MediaPlayer mp; private String path = "/data/data/payoda.android/funny.mp4"; //private String path = "http://www.daily3gp.com/vids/3.3gp"; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); preview=(VideoView)findViewById(R.id.surface); holder=preview.getHolder(); b=(Button)findViewById(R.id.cmd_play); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { try { mp=new MediaPlayer(); mp.setDataSource(path); mp.setScreenOnWhilePlaying(true); mp.setDisplay(holder); mp.prepare(); mp.start(); } catch(Exception e) { } } }); } } </code></pre> <p>The Exception thorwn is:</p> <pre><code>prepare failed: status=0xC8 </code></pre> <p>The LogCat details are:</p> <pre><code>09-16 12:16:36.729: ERROR/PlayerDriver(542): Command PLAYER_INIT completed with an error or info PVMFErrContentInvalidForProgressivePlayback 09-16 12:16:36.739: ERROR/MediaPlayer(2867): error (200, -27) </code></pre> <p>In the above code if change the path variable the Emulator screen is black with single button.May be i have to do some more things to display the video from the Remote URL,i dont know what to do.Any one having any idea about this please help Me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload