Class Video
- All Implemented Interfaces:
android.os.Parcelable
,Serializable
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Convenience Builder to build Video objects.static @interface
Any method attempting to callsetDownloadId(UUID)
must be annotated explicitly with this annotation.static @interface
Any method attempting to callsetLicenseExpiryDate(Date)
must be annotated explicitly with this annotation.static @interface
Any method attempting to callsetOfflinePlaybackLicenseKey(byte[])
must be annotated explicitly with this annotation.static class
Provides the list of known field names that can appear in the properties Map.static enum
The list of known projection formats.static enum
-
Field Summary
Modifier and TypeFieldDescriptionstatic android.os.Parcelable.Creator<Video>
Creator for de-serializing Video object from the givenParcel
.static final int
Deprecated.static final int
Represent the default duration for a Live Video.static final int
Represent the default duration for a Remote Video (including Remote Live Videos).static final int
The type of the parcelable object.Fields inherited from class com.brightcove.player.model.MetadataObject
properties, TAG
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
ConstructorDescriptionInitializes a new Video with a predefined metadata properties collection and a predefined Set of SourceCollection objects.Video
(Map<String, Object> properties, Set<SourceCollection> sourceCollectionSet, List<CuePoint> cuePoints) Initializes a new Video with a predefined metadata properties collection, a predefined Set of SourceCollection objects, and a list of cue points. -
Method Summary
Modifier and TypeMethodDescriptionstatic Video
createVideo
(String uri) Creates a Video object from a string path.static Video
createVideo
(String uri, DeliveryType type) Creates a Video object from a string path.static Video
createVideo
(String uri, DeliveryType type, Video.ProjectionFormat projectionFormat) Creates a Video object from a string path.static Video
createVideo
(String uri, Video.ProjectionFormat projectionFormat) Creates a Video object from a string path.int
static DeliveryType
detectDeliveryType
(String uri) Attempts to detect the delivery type of the asset URI provided.findHighQualitySource
(DeliveryType deliveryType) Finds the source with highest bitrate for the specified delivery type.findLowQualitySource
(DeliveryType deliveryType) Finds the source with lowest bitrate for the specified delivery type.Ensures that the video properties to conform the expected value types.Retrieve a list of the cue points associated with this Video.It gets the video description from theVideo.Fields.SHORT_DESCRIPTION
video property if available, or an empty string otherwise.Gets the globally unique identifier to the local copy of this video, if any.int
Deprecated.long
Convenience method for obtaining the parsed Duration value from the properties MapgetId()
Convenience method for obtaining the parsed ID from the properties map.Gets the UTC date and time when the offline playback license for this video will expire.It gets the video's long description from theVideo.Fields.LONG_DESCRIPTION
video property if available.getName()
It gets the video name from theVideo.Fields.NAME
video property if available, or an empty string otherwise.byte[]
Gets the key set identifier for the current offline playback license for this video, if any.Gets the poster image source.Gets the list of poster sources.Gets the video format.Convenience method for obtaining the parsed reference identifier from the properties map.getSourceCollectionByDeliveryType
(DeliveryType deliveryType) Retrieve the SourceCollection associated with this Video and the specified Delivery Type.Retrieve a Set of the SourceCollections associated with this Video.ReturnsVideo.Status.OK
when the Video is valid and playable, orVideo.Status.ERROR
where there was an error while retrieving or creating the video.It gets theURI
from theVideo.Fields.STILL_IMAGE_URI
video property if available, or null otherwise.Gets the thumbnail image source.Gets the list of thumbnail sources.boolean
Check if the video is DRM free content.boolean
Checks if this video is an offline copy, if and only if all of its sources are local.final boolean
Checks if the video can be stored locally on the host device.boolean
isOwned()
Checks if the video has a valid purchase license.boolean
isRented()
Checks if the video has a valid rental license.boolean
Checks if this is a 360 degree video.void
setDownloadId
(UUID downloadId) Sets the globally unique identifier to the local copy of this video, if any.void
setLicenseExpiryDate
(Date expiryDate) Sets the UTC date and time when the offline playback license for this video is expected to expire.void
setOfflinePlaybackLicenseKey
(byte[] licenseKeySetId) Sets the key set identifier for the current offline playback license for this video, if any.toString()
void
writeToParcel
(android.os.Parcel parcel, int i) Methods inherited from class com.brightcove.player.model.MetadataObject
getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty
-
Field Details
-
DEFAULT_LIVE_VIDEO_DURATION
public static final int DEFAULT_LIVE_VIDEO_DURATIONDeprecated. Instead use {DEFAULT_LIVE_VIDEO_DURATION_LONG
}- See Also:
-
DEFAULT_LIVE_VIDEO_DURATION_LONG
public static final int DEFAULT_LIVE_VIDEO_DURATION_LONGRepresent the default duration for a Live Video.- See Also:
-
DEFAULT_REMOTE_VIDEO_DURATION
public static final int DEFAULT_REMOTE_VIDEO_DURATIONRepresent the default duration for a Remote Video (including Remote Live Videos).- See Also:
-
PARCEL_OBJECT_TYPE
public static final int PARCEL_OBJECT_TYPEThe type of the parcelable object.- See Also:
-
CREATOR
Creator for de-serializing Video object from the givenParcel
.
-
-
Constructor Details
-
Video
- See Also:
-
Video
Initializes a new Video with a predefined metadata properties collection and a predefined Set of SourceCollection objects.- Parameters:
properties
- the metadata assigned to this instancesourceCollectionSet
- the collections of video asset sources to associate with this Video- Throws:
IllegalArgumentException
- if either or both arguments are null
-
Video
public Video(Map<String, Object> properties, Set<SourceCollection> sourceCollectionSet, List<CuePoint> cuePoints) Initializes a new Video with a predefined metadata properties collection, a predefined Set of SourceCollection objects, and a list of cue points.- Parameters:
properties
- the metadata assigned to this instancesourceCollectionSet
- the collections of video asset sources to associate with this Video- Throws:
IllegalArgumentException
- if either or both arguments are null
-
-
Method Details
-
getStatus
ReturnsVideo.Status.OK
when the Video is valid and playable, orVideo.Status.ERROR
where there was an error while retrieving or creating the video.- Returns:
- the
Video.Status
-
fixProperties
Ensures that the video properties to conform the expected value types.- Returns:
- reference to the video
-
detectDeliveryType
Attempts to detect the delivery type of the asset URI provided.- Parameters:
uri
- the asset uri- Returns:
- the delivery type
-
createVideo
Creates a Video object from a string path. The video's delivery type will be set for URLs whose path end with .mp4 and .m3u(8). Otherwise it will be UNKNOWN.- Parameters:
uri
- String URI to video- Returns:
- the created Video object
-
createVideo
Creates a Video object from a string path. The video's delivery type will be set for URLs whose path end with .mp4 and .m3u(8). Otherwise it will be UNKNOWN.- Parameters:
uri
- String URI to videoprojectionFormat
- the video projectionFormat- Returns:
- the created Video object
-
createVideo
Creates a Video object from a string path.- Parameters:
uri
- String URI to videotype
- DeliveryType- Returns:
- the created Video object
-
createVideo
public static Video createVideo(@NonNull String uri, @Nullable DeliveryType type, @Nullable Video.ProjectionFormat projectionFormat) Creates a Video object from a string path.- Parameters:
uri
- String URI to videotype
- DeliveryTypeprojectionFormat
- the projection format- Returns:
- the created Video object
-
getCuePoints
Retrieve a list of the cue points associated with this Video.- Returns:
- a list of cue points or null if there are no cue points.
-
getSourceCollections
Retrieve a Set of the SourceCollections associated with this Video.- Returns:
- a collection of grouped Source video assets for this video
-
getSourceCollectionByDeliveryType
Retrieve the SourceCollection associated with this Video and the specified Delivery Type. It returns null if no SourceCollection was found.- Returns:
- the associated SourceCollection
-
findHighQualitySource
Finds the source with highest bitrate for the specified delivery type.- Parameters:
deliveryType
- the delivery type.- Returns:
- null if a source was not found otherwise reference to the source.
-
findLowQualitySource
Finds the source with lowest bitrate for the specified delivery type.- Parameters:
deliveryType
- the delivery type.- Returns:
- null if a source was not found otherwise reference to the source.
-
toString
- Overrides:
toString
in classMetadataObject
-
getId
Convenience method for obtaining the parsed ID from the properties map.- Returns:
- String representing the ID of the Video. Returns empty string if none exists
-
getReferenceId
Convenience method for obtaining the parsed reference identifier from the properties map.- Returns:
- the video reference identifier, or an empty string if the video does not have reference identifier.
-
getDuration
Deprecated.Convenience method for obtaining the parsed Duration value from the properties Map- Returns:
- the Duration, in milliseconds as an Integer. 0 if no duration key found, if the value fails to parse (e.g. if "zzz" is in the duration), or if the duration is actually 0 (as can be the case for remote Video objects)
-
getDurationLong
public long getDurationLong()Convenience method for obtaining the parsed Duration value from the properties Map- Returns:
- the Duration, in milliseconds as a Long. 0 if no duration key found, if the value fails to parse (e.g. if "zzz" is in the duration), or if the duration is actually 0 (as can be the case for remote Video objects)
-
getProjectionFormat
Gets the video format.- Returns:
- reference to the projection format. Default is
Video.ProjectionFormat.NORMAL
-
isVideo360
public boolean isVideo360()Checks if this is a 360 degree video.- Returns:
- true if the video is a 360 degree video, otherwise false.
-
isClearContent
public boolean isClearContent()Check if the video is DRM free content.- Returns:
- true if the video is DRM free, otherwise false.
-
isOfflinePlaybackAllowed
public final boolean isOfflinePlaybackAllowed()Checks if the video can be stored locally on the host device. A video is considered storable if it hasVideo.Fields.ODRM_PLAYBACK_ALLOWED
flag set and has at least one DRM enabled source.- Returns:
- true if the video can be stored, otherwise false.
-
getName
It gets the video name from theVideo.Fields.NAME
video property if available, or an empty string otherwise.- Returns:
- the video's name.
-
getDescription
It gets the video description from theVideo.Fields.SHORT_DESCRIPTION
video property if available, or an empty string otherwise.- Returns:
- the video's description.
-
getLongDescription
It gets the video's long description from theVideo.Fields.LONG_DESCRIPTION
video property if available.- Returns:
- the video's long description.
-
getStillImageUri
It gets theURI
from theVideo.Fields.STILL_IMAGE_URI
video property if available, or null otherwise. NOTE: It is recommended to usegetPosterImage()
instead.- Returns:
- the Still Image
- See Also:
-
getPosterImage
Gets the poster image source. It selects a source from the list ofVideo.Fields.POSTER_SOURCES
in the Video properties if available, giving preference to the HTTPS version of the poster source. If theVideo.Fields.POSTER_SOURCES
video property is not available, it will return theVideo.Fields.STILL_IMAGE_URI
video property, or null otherwise.- Returns:
- the poster image
-
getThumbnail
Gets the thumbnail image source. It selects a source from the list ofVideo.Fields.THUMBNAIL_SOURCES
in the Video properties if available, giving preference to the HTTPS version of the thumbnail source. If theVideo.Fields.THUMBNAIL_SOURCES
video property is not available, it will return theVideo.Fields.THUMBNAIL
video property, or null otherwise.- Returns:
- the thumbnail
-
getPosterSources
Gets the list of poster sources. It gets the list from theVideo.Fields.POSTER_SOURCES
video property if available, or an empty list otherwise.- Returns:
- the poster sources
-
getThumbnailSources
Gets the list of thumbnail sources. It gets the list from theVideo.Fields.THUMBNAIL_SOURCES
video property if available, or an empty list otherwise.- Returns:
- the thumbnail sources
-
isOwned
public boolean isOwned()Checks if the video has a valid purchase license.- Returns:
- true if the video is owned, otherwise false.
-
isRented
public boolean isRented()Checks if the video has a valid rental license.- Returns:
- true if the video is rented, otherwise false.
-
getDownloadId
Gets the globally unique identifier to the local copy of this video, if any.- Returns:
- null if there is no local copy of the video, otherwise the globally unique identifier.
-
setDownloadId
Sets the globally unique identifier to the local copy of this video, if any. This method exists so that globally unique identifier can be accessed conveniently from the associated video object.
This method can be called only by methods within the SDK that have explicit permission.
- Parameters:
downloadId
- null if there is no local copy of the video, otherwise the globally unique identifier.- Throws:
UnsupportedOperationException
- if the caller is not permitted to call this method.
-
getOfflinePlaybackLicenseKey
@Nullable public byte[] getOfflinePlaybackLicenseKey()Gets the key set identifier for the current offline playback license for this video, if any.- Returns:
- null if the video has no offline playback license, otherwise the license key identifier.
-
setOfflinePlaybackLicenseKey
public void setOfflinePlaybackLicenseKey(@Nullable byte[] licenseKeySetId) Sets the key set identifier for the current offline playback license for this video, if any. This method exists so that the license key set identifier can be accessed conveniently from the associated video object. Setting or clearing the license key set identifier directly using this method will not grant or release the offline playback license.
This method can be called only by methods within the SDK that have explicit permission.
- Parameters:
licenseKeySetId
- null if the video has no offline playback license, otherwise the license key identifier.- Throws:
UnsupportedOperationException
- if the caller is not permitted to call this method.
-
getLicenseExpiryDate
Gets the UTC date and time when the offline playback license for this video will expire.- Returns:
- null if the video has no offline playback license, otherwise the date.
-
setLicenseExpiryDate
Sets the UTC date and time when the offline playback license for this video is expected to expire. Please note that changing this value here will not change the actual license expiry date. This method exists so that license expiry date can be accessed conveniently from the associated video object.
This method can be called only by methods within the SDK that have explicit permission.
- Parameters:
expiryDate
- null if the video has no offline playback license, otherwise the date.- Throws:
UnsupportedOperationException
- if the caller is not permitted to call this method.
-
isOfflineCopy
public boolean isOfflineCopy()Checks if this video is an offline copy, if and only if all of its sources are local.- Returns:
- true if the video is an offline copy, otherwise false.
- See Also:
-
getPreviewThumbnailSources
- Returns:
- a list of available sources with the preview thumbnails of the video.
-
describeContents
public int describeContents()- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-