1

We are trying the Android VLC LIb from the URL.

We won't able to catch exception if play rtsp stream fails.

Code: mMediaPlayer.play();

How can we catch exception if anything fails in calling above method.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
vikram jeet singh
  • 3,416
  • 2
  • 21
  • 22

1 Answers1

0

Just explored bit more, It seems Latest version of Android VLC SDK Wrapper 1.9.8 have support of tracking events.(https://github.com/mrmaffen/vlc-android-sdk)

Code:

try {

        options = new ArrayList<String>();

        options.add("-vvv"); // verbosity
        options.add("--extraintf=logger");
        options.add("--verbose=0");
        options.add("--log-verbose=0");
        options.add("--rtsp-tcp");

        mLibVLC = new LibVLC(options);

        mMediaPlayer = new MediaPlayer(mLibVLC);
        mMediaPlayer.setEventListener(mPlayerListener);

        videoView.setVideoPath(mMediaUrl);
        videoView.setVideoURI(Uri.parse(mMediaUrl));
        videoView.setMediaController(new MediaController(this));
        videoView.setOnPreparedListener(new android.media.MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(android.media.MediaPlayer mp) {
                Log.d("TAG", "OnPrepared called");
            }
        });

        videoView.start();
    } catch (Exception e){
        Log.e(TAG, e.toString());
    }

Logs attached below:

enter image description here

vikram jeet singh
  • 3,416
  • 2
  • 21
  • 22