There are two media files hosted on external servers - audio and video. I need to mux them and play as online stream through Android MediaPlayer class.
The main problem, is that I don't know, if there is any possible solution for continuous download-mux-play process. I've seen examples of MediaMuxer class usage, but only with local files.
Currently, I just start two media players like this :
//Setting up video
MediaPlayer video = new MediaPlayer();
video.setDataSource("videurl");
video.prepare();
//Setting up audio
MediaPlayer audio = new MediaPlayer();
video.setDataSource("audiourl");
video.prepare();
//Starting both players simultaneously
video.start();
audio.start();
But, of course, this gives terrible synchronization between audio and video. So, the question is - is this even possible to mux online streams, and if yes - where do I start research?