Closed KeySeeDev closed 5 years ago
See https://github.com/googlevr/gvr-android-sdk/blob/master/samples/sdk-video360/src/main/java/com/google/vr/sdk/samples/video360/VideoUiView.java#L157 is the code that handles the UI for 2D & VR mode.
Thanks you for the help. Yep, i tried to look at that code and tried adding
public void myPause() {
try {
mediaLoader.pause();
} catch (Exception e) { Log.d(TAG, "Error while trying mediaLoader.pause();"); };
try {
mediaLoader.mediaPlayer.pause();
} catch (Exception e) { Log.d(TAG, "Error while trying mediaLoader.mediaPlayer.pause();"); };
try {
(new MediaLoader(this)).mediaPlayer.pause();
} catch (Exception e) { Log.d(TAG, "Error while trying mediaLoader.pause();"); };
}
and to run that function I'm using (new VrVideoActivity()).myPause();
If you need more info you can find the repo here: https://github.com/StarStep/cordova-vr-help
GVR: cordova-vr-help/platforms/android/app/src/main/java/com/thevrplugin/cordovapluginvrplayer/
Finally got it to work by declaring as static the MediaLoader
public static MediaLoader mediaLoader;
and then I were able to interact with the player like so
public static void myPause() {
mediaLoader.mediaPlayer.pause();
}
Hi, i trying to implement some basic media player functions on top of the vr360 project but i cant make it work. I tried to add inside a custom function to begin with but the media player seems unvailable... How to bind it? Thanks for any help.
PS. I'm preparing a mini-project repo if maybe someone fancies to try.