Can't I make an Android video application using HTTP GET?

Asked 2 years ago, Updated 2 years ago, 95 views

Hello. I don't know what kind of video technology there is, but I think I can just show the images continuously, so I'm asking you a question. Isn't it normal to just download images using HTTP GET and spray them on ImageView or SurfaceView of the app?You don't have to make a sound. That's all I can think about.

http android

2022-09-22 21:51

1 Answers

It would be better to use VideoView rather than using images.

Below is the sample code I searched and found.

@Override
protected void onCreate(Bundle savedInstanceState)
     // // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    try {
        setContentView(R.layout.videodisplay);
        String link="http://s1133.photobucket.com/albums/m590/Anniebabycupcakez/?action=view& current=1376992942447_242.mp4";
        VideoView videoView = (VideoView) findViewById(R.id.VideoView);
        MediaController mediaController = new MediaController(this);
        mediaController.setAnchorView(videoView);
        Uri video = Uri.parse(link);
        videoView.setMediaController(mediaController);
        videoView.setVideoURI(video);
        videoView.start();
    } } catch (Exception e) {
        // // TODO: handle exception
        Toast.makeText(this, "Error connecting", Toast.LENGTH_SHORT).show();
    }
}


2022-09-22 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.