I am building an android app that can play video files remotely. I want to stream video files using SFTP, because it was the easiest and fastest to set up, because i already had an SSH connection to the server. In the official VLC app, both on windows and android plays the file just fine, no issues. But in my app when using libvlc, it just does not work. It keeps stalling, because it seems like it can't load the image according to the log:
Code: Select all
libvlc video output: picture is too late to be displayed (missing 206 ms)
libvlc video output: picture is too late to be displayed (missing 82 ms)
Code: Select all
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ArrayList<String> args = new ArrayList<>();
args.add("-vvv");
mLibVLC = new LibVLC(this, args);
mMediaPlayer = new MediaPlayer(mLibVLC);
mVideoLayout = findViewById(R.id.video_layout);
}
@Override
protected void onStart()
{
super.onStart();
mMediaPlayer.attachViews(mVideoLayout, null, ENABLE_SUBTITLES, USE_TEXTURE_VIEW);
final Media media = new Media(mLibVLC, Uri.parse(fileUri));
mMediaPlayer.setMedia(media);
media.release();
mMediaPlayer.play();
}
I would really appreciate if someone could help me.
i am using org.videolan.android:libvlc-all:4.0.0-eap14 package
EDIT: One last thing i tried is to test the app on a phone, not just in the emulator, and as it turns out, only the emulator could not keep up, on the phone it worked fine. It's strange, because like 3 weeks ago it worked on emulator too.