Unable to use the streaming URL from VLC

Viewed 18

I'm trying to stream videos from VLC Player to my android app using ExoPlayer. I followed all the steps and then try to access "http://192.168.137.1:8080/" to check if the URL is working. Then my browser starts download this:

enter image description here

But the URL just does not work in my code.

My main activity file:

 public class MainActivity extends AppCompatActivity
{
    private PlayerView Video_screen;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Video_screen = findViewById(R.id.Video_screen);

        SimpleExoPlayer player = new SimpleExoPlayer.Builder(this).build();

        Video_screen = findViewById(R.id.Video_screen);
        Video_screen.setPlayer(player);

        MediaItem item = MediaItem.fromUri("http://192.168.137.1:8080");
        player.addMediaItem(item);
        player.prepare();
        player.play();
    }
}

My code works when I replace the localhost URL with this URL collected from "public video test" in github.
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4

What could be the problem ?
My file is a .mp4 file

0 Answers
Related