Class ScreenSizeThumbnailFormatSelector
- java.lang.Object
-
- com.brightcove.player.mediacontroller.ScreenSizeThumbnailFormatSelector
-
- All Implemented Interfaces:
PreviewThumbnailFormatSelector
public class ScreenSizeThumbnailFormatSelector extends java.lang.Object implements PreviewThumbnailFormatSelector
Selects the thumbnail format based on the screen size of the device.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScreenSizeThumbnailFormatSelector
create(android.content.Context context)
Creates a new ScreenSizeThumbnailFormatSelector with a default factor of 0.5.static ScreenSizeThumbnailFormatSelector
create(android.content.Context context, float factor)
The factor parameter represents a percentage of the screen width and screen height.PreviewThumbnailFormat
select(java.util.List<PreviewThumbnailFormat> previewThumbnailFormatList)
Selects aPreviewThumbnailFormat
from a given list.
-
-
-
Method Detail
-
create
public static ScreenSizeThumbnailFormatSelector create(android.content.Context context)
Creates a new ScreenSizeThumbnailFormatSelector with a default factor of 0.5.- Parameters:
context
- an Android Context.- Returns:
- a new instance of ScreenSizeThumbnailFormatSelector.
- See Also:
create(Context, float)
-
create
public static ScreenSizeThumbnailFormatSelector create(android.content.Context context, @FloatRange(from=0.0,to=1.0) float factor)
The factor parameter represents a percentage of the screen width and screen height.- Parameters:
context
- an Android Context.factor
- of screen width and screen height which will be used to select the format. For example an instance with width = 1920, height = 1080 and factor = 0.5 is equivalent to an instance with width = 960, height = 540 and factor = 1.0. The accepted range is from 0.0 to 1.0 otherwise, the value is clamped.- Returns:
- a new instance of ScreenSizeThumbnailFormatSelector.
-
select
@NonNull public PreviewThumbnailFormat select(@NonNull java.util.List<PreviewThumbnailFormat> previewThumbnailFormatList)
Description copied from interface:PreviewThumbnailFormatSelector
Selects aPreviewThumbnailFormat
from a given list.- Specified by:
select
in interfacePreviewThumbnailFormatSelector
- Parameters:
previewThumbnailFormatList
- the list ofPreviewThumbnailFormat
- Returns:
- the selected
PreviewThumbnailFormat
-
-