-
public final class VideoUtil
An Video utility class to perform tasks with Brightcove video objects.
-
-
Method Summary
Modifier and Type Method Description static boolean
addCaptions(@NonNull() Video video, @NonNull() Map<String, String> languageCodeCaptionsMap)
Adds the CAPTION_SOURCES video property with the languageCodeCaptionsMap,if and on only if, the CAPTION_SOURCES doesn't exist. static boolean
toggleClosedCaptions(@NonNull() BaseVideoView videoView)
Utility method to toggle the closed captions. static boolean
isClosedCaptionsEnabled(@NonNull() BaseVideoView videoView)
Utility method to check if closed captions are enabled. static void
addClosedCaptionLanguagesMapToVideo(@NonNull() Video video)
Queries the CAPTION_SOURCES Video property, and builds a Map of language/label references. static void
removeSidecarClosedCaptionSources(@NonNull() Video video)
Removes existing Sidecar Captions Sources because they are likely not aligned with the Ad breaksin the VMAP for SSAI videos.This method does not remove any in-manifest captions. static void
addWatermarkingToken(Video video, String token)
Add a watermarking token to this video's sources if a placeholder is present static boolean
isManifestTtlValid(Video video)
Determine whether the video has the following properties:Video.Fields.MANIFEST_URL_TTLVideo.Fields. static void
filterSourcesOnDeliveryType(Video video, DeliveryType deliveryTypeFilter)
Filter this Video's SourceCollections to include only the specified DeliveryType static void
checkDolbyAtmosSources(Video video)
If device does not support Dolby Atmos features, then filter related Source,only if it is Mpeg-DASH -
-
Method Detail
-
addCaptions
static boolean addCaptions(@NonNull() Video video, @NonNull() Map<String, String> languageCodeCaptionsMap)
Adds the CAPTION_SOURCES video property with the languageCodeCaptionsMap,if and on only if, the CAPTION_SOURCES doesn't exist.
- Parameters:
video
- The video to add the captions to.languageCodeCaptionsMap
- A map of language code to caption urls.
-
toggleClosedCaptions
static boolean toggleClosedCaptions(@NonNull() BaseVideoView videoView)
Utility method to toggle the closed captions.
- Parameters:
videoView
- the video view
-
isClosedCaptionsEnabled
static boolean isClosedCaptionsEnabled(@NonNull() BaseVideoView videoView)
Utility method to check if closed captions are enabled.
- Parameters:
videoView
- the video view
-
addClosedCaptionLanguagesMapToVideo
static void addClosedCaptionLanguagesMapToVideo(@NonNull() Video video)
Queries the CAPTION_SOURCES Video property, and builds a Map of language/label references.
-
removeSidecarClosedCaptionSources
static void removeSidecarClosedCaptionSources(@NonNull() Video video)
Removes existing Sidecar Captions Sources because they are likely not aligned with the Ad breaksin the VMAP for SSAI videos.This method does not remove any in-manifest captions.
-
addWatermarkingToken
static void addWatermarkingToken(Video video, String token)
Add a watermarking token to this video's sources if a placeholder is present
- Parameters:
video
- The video that may have a token placeholder in its Source URLstoken
- The watermarking token that will replace he placeholder in the Source URLs
-
isManifestTtlValid
static boolean isManifestTtlValid(Video video)
Determine whether the video has the following properties:Video.Fields.MANIFEST_URL_TTLVideo.Fields.MANIFEST_TIMESTAMP
If both properties are present and non-null, compute their summed values against the current System time todetermine whether the Video's MANIFEST_TIMESTAMP property is expired
- Parameters:
video
- The video that may have a token placeholder in its Source URLs
-
filterSourcesOnDeliveryType
static void filterSourcesOnDeliveryType(Video video, DeliveryType deliveryTypeFilter)
Filter this Video's SourceCollections to include only the specified DeliveryType
- Parameters:
video
- The Video whose SourceCollections are to be filtereddeliveryTypeFilter
- The DeliveryType to filter the Video's SourceCollectionsExamples:-- If the deliveryTypeFilter is DeliveryType.HLS, then all but the HLS sources in the Video are removedSpecial cases:-- If the specified DeliveryType is DeliveryType.DASH, then all but the DASH Sources will befiltered out of this Video-- If the specified DeliveryType is not found in the SourceCollection's keySet, then no Sources will befiltered out of this VideoThis includes DeliveryType.
-
checkDolbyAtmosSources
static void checkDolbyAtmosSources(Video video)
If device does not support Dolby Atmos features, then filter related Source,only if it is Mpeg-DASH
- Parameters:
video
- - Current video
-
-
-
-