public final class VideoUtil
extends java.lang.Object
Constructor and Description |
---|
VideoUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addCaptions(Video video,
java.util.Map<java.lang.String,java.lang.String> languageCodeCaptionsMap)
Adds the
Video.Fields#CAPTION_SOURCES video property with the languageCodeCaptionsMap,
if and on only if, the Video.Fields#CAPTION_SOURCES doesn't exist. |
static void |
addClosedCaptionLanguagesMapToVideo(Video video)
Queries the CAPTION_SOURCES Video property, and builds a Map of language/label references.
|
static void |
addWatermarkingToken(Video video,
java.lang.String token)
Add a watermarking token to this video's sources if a placeholder is present
|
static void |
filterSourcesOnDeliveryType(Video video,
DeliveryType deliveryTypeFilter)
Filter this Video's SourceCollections to include only the specified DeliveryType
|
static boolean |
isClosedCaptionsEnabled(BaseVideoView videoView)
Utility method to check if closed captions are enabled.
|
static boolean |
isManifestTtlValid(Video video)
Determine whether the video has the following properties:
Video.Fields.MANIFEST_URL_TTL
Video.Fields.MANIFEST_TIMESTAMP
If both properties are present and non-null, compute their summed values against the current System time to
determine whether the Video's MANIFEST_TIMESTAMP property is expired
|
static void |
removeSidecarClosedCaptionSources(Video video)
Removes existing Sidecar Captions Sources because they are likely not aligned with the Ad breaks
in the VMAP for SSAI videos.
|
static boolean |
toggleClosedCaptions(BaseVideoView videoView)
Utility method to toggle the closed captions.
|
public static boolean addCaptions(@NonNull Video video, @NonNull java.util.Map<java.lang.String,java.lang.String> languageCodeCaptionsMap)
Video.Fields#CAPTION_SOURCES
video property with the languageCodeCaptionsMap,
if and on only if, the Video.Fields#CAPTION_SOURCES
doesn't exist.video
- The video to add the captions to.languageCodeCaptionsMap
- A map of language code to caption urls.public static boolean toggleClosedCaptions(@NonNull BaseVideoView videoView)
videoView
- the video viewpublic static boolean isClosedCaptionsEnabled(@NonNull BaseVideoView videoView)
videoView
- the video viewpublic static void addClosedCaptionLanguagesMapToVideo(@NonNull Video video)
public static void removeSidecarClosedCaptionSources(@NonNull Video video)
public static void addWatermarkingToken(Video video, java.lang.String token)
video
- The video that may have a token placeholder in its Source URLstoken
- The watermarking token that will replace he placeholder in the Source URLspublic static boolean isManifestTtlValid(Video video)
video
- The video that may have a token placeholder in its Source URLspublic static void filterSourcesOnDeliveryType(Video video, DeliveryType deliveryTypeFilter)
video
- The Video whose SourceCollections are to be filtereddeliveryTypeFilter
- The DeliveryType to filter the Video's SourceCollections
Examples:
-- If the deliveryTypeFilter is DeliveryType.HLS, then all but the HLS sources in the Video are removed
Special cases:
-- If the specified DeliveryType is DeliveryType.DASH, then all but the DASH Sources will be
filtered out of this Video
-- If the specified DeliveryType is not found in the SourceCollection's keySet, then no Sources will be
filtered out of this Video
This includes DeliveryType.UNKNOWN