Class DeviceOrientationDelegate
java.lang.Object
com.jwplayer.pub.api.fullscreen.delegates.DeviceOrientationDelegate
Responsible for changing the device orientation during fullscreen and listening to changes in device orientation to enter or exit fullscreen.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Used to store whether fullscreen can be exited by rotation. -
Constructor Summary
ConstructorsConstructorDescriptionDeviceOrientationDelegate
(Activity activity, Lifecycle lifecycle, Handler handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doRotation
(boolean fullscreen, boolean allowFullscreenPortrait) Force the screen orientation to change.protected void
Starts a orientation event listener.void
onAllowFullscreenPortrait
(boolean allowFullscreenPortrait) void
onAllowRotationChanged
(boolean allowRotation) void
onStateChanged
(LifecycleOwner source, Lifecycle.Event event) void
setFullscreen
(boolean fullscreen)
-
Field Details
-
mAllowRotation
protected boolean mAllowRotationUsed 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)
-