0

Can anyone tell me how to use videoview to play mp4 url. I have written the code which is giving me error in my logcat as:

08-05 04:37:35.978: D/MediaPlayer(1693): getMetadata
08-05 04:37:37.918: E/MediaPlayer(1693): error (1, -19)
08-05 04:37:37.928: E/MediaPlayer(1693): Error (1,-19)
08-05 04:37:37.928: D/VideoView(1693): Error: 1,-19

I am using the videoview java code as:

public class VideoPlayerActivity extends Activity {

    @SuppressLint("NewApi")
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.video_play);


        VideoView videoView = (VideoView) findViewById(R.id.videoview_video);
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(videoView);
        System.out.println(mediaController);
        Uri video = Uri.parse("http://192.168.1.100/Android/jum.mp4");
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(video);
        System.out.println("View:"+videoView);
        videoView.start();

    }
}

I have made the video as H 264 compressed format but also i am not able to watch and listen the video in the android app

Error in the android emulator is as shown below: enter image description here

ANNN CHOOOR
  • 115
  • 2
  • 13

1 Answers1

0
  • Did you set the internet permission in Manifest file?

  • Are you sure its http and not https ?

  • Are you running a version earlier than 3.1 ? If so, is the audio encoding through AACP?

These are some of the reasons that could give that error.

Dr. Mohan
  • 26
  • 4
  • Yes i have set internet permission and yes it not https and i am using 4.3 version sdk @Jing and also i am using the H 264 compressed format videos – ANNN CHOOOR Aug 05 '14 at 09:19