Class DeviceOrientationDelegate

java.lang.Object
com.jwplayer.pub.api.fullscreen.delegates.DeviceOrientationDelegate

public class DeviceOrientationDelegate extends Object
Responsible for changing the device orientation during fullscreen and listening to changes in device orientation to enter or exit fullscreen.
  • Field Details

    • mAllowRotation

      protected boolean mAllowRotation
      Used to store whether fullscreen can be exited by rotation.
  • Constructor Details

    • DeviceOrientationDelegate

      public DeviceOrientationDelegate(Activity activity, Lifecycle lifecycle, Handler handler)
  • Method Details

    • setFullscreen

      public void setFullscreen(boolean fullscreen)
    • onStateChanged

      public void onStateChanged(LifecycleOwner source, Lifecycle.Event event)
    • onAllowRotationChanged

      public void onAllowRotationChanged(boolean allowRotation)
    • doRotation

      protected void doRotation(boolean fullscreen, boolean allowFullscreenPortrait)
      Force the screen orientation to change.

      Default behavior is to force LANDSCAPE/REVERSE_LANDSCAPE when fullscreen == true and PORTRAIT when fullscreen == false.

      Parameters:
      fullscreen - True when entering fullscreen.
    • doRotationListener

      protected void doRotationListener()
      Starts a orientation event listener.
    • onAllowFullscreenPortrait

      public void onAllowFullscreenPortrait(boolean allowFullscreenPortrait)