Abbas
Abbas

Reputation: 3331

OnCompletion called after variable length of time while playing live stream

I have an Android App in which I am playing media streams from URL. Streams are playing fine on all devices except two: Nexus 7 OS 5.0.2 and another Nexus 4 OS 6.0.1. On these devices occasionally OnCompletionListener() is fired while playing at random intervals (ranging from 30 seconds to 10 mins).

All these streams seem to be working fine on other devices (I haven't got another device running OS 6.0.1) but OS 5.0.1 and OS 5.1 works nicely.

I have searched for almost two days on google for a solution or even a similar case but haven't found anything.

So these are my questions

  1. Is this an issue with Nexus devices?
  2. If so then is there a way to correct this behavior?

EDIT 1 : There is no SeekBar or MediaController since all the streams are live. The code for initializing VideoView

 if (videoView == null)
            videoView = new ExtVideoView(mContext);
        videoPlayerLlyout.addView(videoView);

        videoView.setVideoURI(Uri.parse(playLink));
        videoView.screenMode = ExtVideoView.DisplayMode.FULL_SCREEN;

        videoView.setOnCompletionListener(this);
        videoView.setOnErrorListener(this);
        videoView.setOnPreparedListener(this);
        videoView.setOnTouchListener(this);

And then in the onPrepared()

if(!isFragmentPaused)
    {
        mp.start();
    }

    mp.setOnBufferingUpdateListener(this);
    mp.setOnInfoListener(this);
    mp.setOnSeekCompleteListener(this);

In the onCompletion() method I am simply playing the next live-stream item in a list.

Upvotes: 0

Views: 130

Answers (0)

Related Questions