0

For some reason the VideoPlayer in my android app won't play any video files, but only when they are located on my Raspberry-pi. This is the code for playing the video:

    VideoView videoView = findViewById(R.id.videoView);
    videoView.setVideoPath("https://ia800201.us.archive.org/22/items/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4");
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    videoView.setMediaController(mediaController);
    videoView.start();

This works perfectly fine, and will play the video just fine. However, when I download the video and move it to my Raspberry Pi, it doesn't work anymore. The video is hosted using lighttpd and the URL for the video becomes "http://192.168.4.1/video2.mp4". (The Pi is hosting its own access point to which the phone connects).

When accessing this link in the browser, it plays the video perfectly fine, but when using this link in VideoView.setVideoPath() it won't load and eventually displays the message "Can't play this video".

I do not understand why this doesn't work, since the video played using the original URL, and when using the raspberry pi's IP address in the browser it plays as well.

Alessio
  • 3,404
  • 19
  • 35
  • 48
Conner Dassen
  • 729
  • 4
  • 11
  • 28

0 Answers0