danylovolokh/VideoPlayerManager

Way to Set looping on MediaPlayer?

Opened this issue · 2 comments

Hi, is there a way to set a video to looping? I see the method in the MediaPlayerWrapper, but there's no good example of how to call this method from any of the other classes (VideoView or the VideoPlayerManager)

Hi,

I had a similar question a few days ago.

There is a problem with looping on some devices. We cannot use native method MediaPlayer.setLooping().

We've seen the problem with some Samsung or running Anroid 5.0 with NuPlayer. They just ignore this call to MediaPlayer.setLooping().

You have to run the full cycle again : reset, release, setDataSource, prepare, start.

It's very screwed up, but I didn't find any other way. For now. Maybe we can rewind somehow to the start or something.

Ah OK. Yeah, I've definitely seen this behavior, esp on Samsung devices.
I've got a hack in my current video implementation that attempts to detect
bad loops and restart the vid, but it's not fool proof.

The nice thing abt the native loop (when it works) is that it keeps the
video buffered. Tearing down and restarting won't let you loop seamlessly.
On Feb 12, 2016 17:23, "Danylo Volokh" notifications@github.com wrote:

Hi,

I had a similar question a few days ago.

There is a problem with looping on some devices. We cannot use native
method MediaPlayer.setLooping().

We've seen the problem with some Samsung or running Anroid 5.0 with
NuPlayer. They just ignore this call to MediaPlayer.setLooping().

You have to run the full cycle again : reset, release, setDataSource,
prepare, start.

It's very screwed up, but I didn't find any other way. For now. Maybe we
can rewind somehow to the start or something.


Reply to this email directly or view it on GitHub
#16 (comment)
.