googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

Buffered position #566

Closed tundisi closed 6 years ago

tundisi commented 6 years ago

Hello, it's a pleasure.

I was reviewing the general documentation and I can not find a way to know the percentage of the buffer.

Checking the code in the VrVideoView class in the videoPlayer.getExoPlayer() object there is an interface called ac that has the getBufferedPosition and getBufferedPercentage events but they are protected by the fact that the video player object is private.

the code would look something like this:

public long getBufferedPosition () {
        VrVideoPlayer var3 = this.videoPlayer;
        synchronized (this.videoPlayer) {
            long var1 = this.videoPlayer.getExoPlayer (). getBufferedPosition ();
            return var1;
        }
    }

public int getBufferedPercentage () {
        VrVideoPlayer var3 = this.videoPlayer;
        synchronized (this.videoPlayer) {
            long var1 = this.videoPlayer.getExoPlayer (). getBufferedPercentage ();
            return var1;
        }
    }

Would you be so kind to add these lines?

I read in this thread https://github.com/googlevr/gvr-android-sdk/issues/347 that I did not intend to add this functionality for now, I do not know if they do not yet have it, but it would be very helpful for me and the community to know the buffer percentage.

Stay tuned for your comments.

Hug, greetings

AlvaroFalcon commented 6 years ago

Any solution to this?

sigmaxipi commented 6 years ago

We have no plans to add this functionality to VrWidgetView. Instead we created the video360 sample which demonstrates creating a custom 360 viewer and you can add whatever functionality you need. See #510 for more info.