Class BrightcovePictureInPictureParams.Builder
- java.lang.Object
-
- com.brightcove.player.pictureinpicture.BrightcovePictureInPictureParams.Builder
-
- Enclosing class:
- BrightcovePictureInPictureParams
public static class BrightcovePictureInPictureParams.Builder extends java.lang.Object
Builder class forBrightcovePictureInPictureParams
objects.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BrightcovePictureInPictureParams
build()
BrightcovePictureInPictureParams.Builder
setActions(java.util.List<android.app.RemoteAction> actions)
Sets the user actions.BrightcovePictureInPictureParams.Builder
setAspectRatio(android.util.Rational aspectRatio)
Sets the aspect ratio.BrightcovePictureInPictureParams.Builder
setClosedCaptionsEnabled(boolean closedCaptionsEnabled)
Enables or disables closed captions for Picture in Picture mode.BrightcovePictureInPictureParams.Builder
setClosedCaptionsReductionScaleFactor(float scaleFactor)
Sets reduction the scale factor for closed captions when entering Picture in Picture mode.BrightcovePictureInPictureParams.Builder
setOnUserLeaveEnabled(boolean onUserLeaveEnabled)
Enables or disables entering into Picture in Picture mode when the user has put the activity in the background, for example, when of pressing the Home key.BrightcovePictureInPictureParams.Builder
setSourceRectHint(android.graphics.Rect launchBounds)
Sets the source bounds hint.
-
-
-
Method Detail
-
setAspectRatio
public BrightcovePictureInPictureParams.Builder setAspectRatio(android.util.Rational aspectRatio)
Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and does not change upon device rotation.- Parameters:
aspectRatio
- the new aspect ratio for the activity in picture-in-picture, must be between 2.39:1 and 1:2.39 (inclusive).- Returns:
- this builder instance.
-
setActions
public BrightcovePictureInPictureParams.Builder setActions(java.util.List<android.app.RemoteAction> actions)
Sets the user actions. If there are more thanActivity.getMaxNumPictureInPictureActions()
actions, then the input list will be truncated to that number.- Parameters:
actions
- the new actions to show in the picture-in-picture menu.- Returns:
- this builder instance.
- See Also:
RemoteAction
-
setSourceRectHint
public BrightcovePictureInPictureParams.Builder setSourceRectHint(android.graphics.Rect launchBounds)
Sets the source bounds hint. These bounds are only used when an activity first enters picture-in-picture, and describe the bounds in window coordinates of activity entering picture-in-picture that will be visible following the transition. For the best effect, these bounds should also match the aspect ratio in the arguments.- Parameters:
launchBounds
- window-coordinate bounds indicating the area of the activity that will still be visible following the transition into picture-in-picture (eg. the video view bounds in a video player)- Returns:
- this builder instance.
-
setClosedCaptionsEnabled
public BrightcovePictureInPictureParams.Builder setClosedCaptionsEnabled(boolean closedCaptionsEnabled)
Enables or disables closed captions for Picture in Picture mode.- Parameters:
closedCaptionsEnabled
- true to enable closed captions.- Returns:
- this builder instance.
-
setOnUserLeaveEnabled
public BrightcovePictureInPictureParams.Builder setOnUserLeaveEnabled(boolean onUserLeaveEnabled)
Enables or disables entering into Picture in Picture mode when the user has put the activity in the background, for example, when of pressing the Home key.- Parameters:
onUserLeaveEnabled
- true to enable.- Returns:
- this builder instance.
-
setClosedCaptionsReductionScaleFactor
public BrightcovePictureInPictureParams.Builder setClosedCaptionsReductionScaleFactor(float scaleFactor)
Sets reduction the scale factor for closed captions when entering Picture in Picture mode. The values accepted must be between 0 and 1.- Parameters:
scaleFactor
- the scale factor- Returns:
- this builder instance.
-
build
public BrightcovePictureInPictureParams build()
- Returns:
- an immutable
BrightcovePictureInPictureParams
to be used when entering or updating the activity in picture-in-picture.
-
-