Class VideoUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addCaptions
(Video video, Map<String, String> languageCodeCaptionsMap) Adds theVideo.Fields.CAPTION_SOURCES
video property with the languageCodeCaptionsMap, if and on only if, theVideo.Fields.CAPTION_SOURCES
doesn't exist.static void
Queries the CAPTION_SOURCES Video property, and builds a Map of language/label references.static void
addWatermarkingToken
(Video video, String token) Add a watermarking token to this video's sources if a placeholder is presentstatic void
checkDolbyAtmosSources
(Video video) If device does not support Dolby Atmos features, then filter relatedSource
, only if it is Mpeg-DASHstatic void
filterSourcesOnDeliveryType
(Video video, DeliveryType deliveryTypeFilter) Filter this Video's SourceCollections to include only the specified DeliveryTypestatic 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_TIMESTAMPstatic void
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.
-
Constructor Details
-
VideoUtil
public VideoUtil()
-
-
Method Details
-
addCaptions
public static boolean addCaptions(@NonNull Video video, @NonNull Map<String, String> languageCodeCaptionsMap) Adds theVideo.Fields.CAPTION_SOURCES
video property with the languageCodeCaptionsMap, if and on only if, theVideo.Fields.CAPTION_SOURCES
doesn't exist.- Parameters:
video
- The video to add the captions to.languageCodeCaptionsMap
- A map of language code to caption urls.- Returns:
- true if the captions were added to the video
-
toggleClosedCaptions
Utility method to toggle the closed captions.- Parameters:
videoView
- the video view- Returns:
- true if closed captions were enabled.
-
isClosedCaptionsEnabled
Utility method to check if closed captions are enabled.- Parameters:
videoView
- the video view- Returns:
- true if closed captions are enabled.
-
addClosedCaptionLanguagesMapToVideo
Queries the CAPTION_SOURCES Video property, and builds a Map of language/label references. -
removeSidecarClosedCaptionSources
Removes existing Sidecar Captions Sources because they are likely not aligned with the Ad breaks in the VMAP for SSAI videos. This method does not remove any in-manifest captions. -
addWatermarkingToken
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
Determine whether the video has the following properties: Video.Fields.MANIFEST_URL_TTL Video.Fields.MANIFEST_TIMESTAMPIf 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
- Parameters:
video
- The video that may have a token placeholder in its Source URLs
-
filterSourcesOnDeliveryType
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 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
-
checkDolbyAtmosSources
If device does not support Dolby Atmos features, then filter relatedSource
, only if it is Mpeg-DASH- Parameters:
video
- - Current video
-