-
- All Implemented Interfaces:
-
android.os.Parcelable
,java.io.Serializable
public class Video extends MetadataObject implements Parcelable
The Video class is an immutable representation of all data related to a video, including associated metadata (in properties) and the groupings of source assets for this video.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
Video.Status
public @interface
Video.CanSetDownloadIdentifier
Any method attempting to call setDownloadId must be annotated explicitly withthis annotation.
public @interface
Video.CanSetLicenseExpiryDate
Any method attempting to call setLicenseExpiryDate must be annotated explicitlywith this annotation.
public @interface
Video.CanSetLicenseKeySetId
Any method attempting to call setOfflinePlaybackLicenseKey must be annotatedexplicitly with this annotation.
public class
Video.Builder
Convenience Builder to build Video objects.
public class
Video.Fields
Provides the list of known field names that can appear in the properties Map.
public enum
Video.ProjectionFormat
The list of known projection formats.
-
Field Summary
Fields Modifier and Type Field Description private final Video.Status
status
public final static int
DEFAULT_LIVE_VIDEO_DURATION
public final static int
DEFAULT_LIVE_VIDEO_DURATION_LONG
public final static int
DEFAULT_REMOTE_VIDEO_DURATION
private List<CuePoint>
cuePoints
private UUID
downloadId
private Date
licenseExpiryDate
public final static int
PARCEL_OBJECT_TYPE
public static Parcelable.Creator<Video>
CREATOR
-
Constructor Summary
Constructors Constructor Description Video(Map<String, Object> properties)
Video(Map<String, Object> properties, Set<SourceCollection> sourceCollectionSet)
Initializes a new Video with a predefined metadata properties collection and apredefined 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, apredefined Set of SourceCollection objects, and a list of cue points.
-
Method Summary
Modifier and Type Method Description Video.Status
getStatus()
Returns OK when the Video is valid and playable,or ERROR where there was an error while retrieving or creating the video. List<CuePoint>
getCuePoints()
Retrieve a list of the cue points associated with this Video. UUID
getDownloadId()
Gets the globally unique identifier to the local copy of this video, if any. void
setDownloadId(@Nullable() UUID downloadId)
Sets the globally unique identifier to the local copy of this video, if any. Date
getLicenseExpiryDate()
Gets the UTC date and time when the offline playback license for this video will expire. void
setLicenseExpiryDate(@Nullable() Date expiryDate)
Sets the UTC date and time when the offline playback license for this video is expected toexpire. Video
fixProperties()
Ensures that the video properties to conform the expected value types. static DeliveryType
detectDeliveryType(@NonNull() String uri)
Attempts to detect the delivery type of the asset URI provided. static Video
createVideo(@NonNull() String uri)
Creates a Video object from a string path. static Video
createVideo(@NonNull() String uri, Video.ProjectionFormat projectionFormat)
Creates a Video object from a string path. static Video
createVideo(@NonNull() String uri, DeliveryType type)
Creates a Video object from a string path. static Video
createVideo(@NonNull() String uri, @Nullable() DeliveryType type, @Nullable() Video.ProjectionFormat projectionFormat)
Creates a Video object from a string path. Map<DeliveryType, SourceCollection>
getSourceCollections()
Retrieve a Set of the SourceCollections associated with this Video. SourceCollection
getSourceCollectionByDeliveryType(DeliveryType deliveryType)
Retrieve the SourceCollection associated with this Video and the specified Delivery Type.It returns null if no SourceCollection was found. Source
findHighQualitySource(@NonNull() DeliveryType deliveryType)
Finds the source with highest bitrate for the specified delivery type. Source
findLowQualitySource(@NonNull() DeliveryType deliveryType)
Finds the source with lowest bitrate for the specified delivery type. String
toString()
String
getId()
Convenience method for obtaining the parsed ID from the properties map. String
getReferenceId()
Convenience method for obtaining the parsed reference identifier from the properties map. int
getDuration()
Convenience method for obtaining the parsed Duration value from the properties Map long
getDurationLong()
Convenience method for obtaining the parsed Duration value from the properties Map Video.ProjectionFormat
getProjectionFormat()
Gets the video format. boolean
isVideo360()
Checks if this is a 360 degree video. boolean
isClearContent()
Check if the video is DRM free content. final boolean
isOfflinePlaybackAllowed()
Checks if the video can be stored locally on the host device. String
getName()
It gets the video name from the NAME video property if available,or an empty string otherwise. String
getDescription()
It gets the video description from the SHORT_DESCRIPTION video property if available,or an empty string otherwise. String
getLongDescription()
It gets the video's long description from the LONG_DESCRIPTION video property if available. URI
getStillImageUri()
It gets the URI from the STILL_IMAGE_URI video property if available,or null otherwise. URI
getPosterImage()
Gets the poster image source. URI
getThumbnail()
Gets the thumbnail image source. Set<URI>
getPosterSources()
Gets the list of poster sources. Set<URI>
getThumbnailSources()
Gets the list of thumbnail sources. boolean
isOwned()
Checks if the video has a valid purchase license. boolean
isRented()
Checks if the video has a valid rental license. Array<byte>
getOfflinePlaybackLicenseKey()
Gets the key set identifier for the current offline playback license for this video, if any. void
setOfflinePlaybackLicenseKey(@Nullable() Array<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 fromthe associated video object. boolean
isOfflineCopy()
Checks if this video is an offline copy, if and only if all of its sources are local. List<PreviewThumbnailFormat>
getPreviewThumbnailSources()
int
describeContents()
void
writeToParcel(Parcel parcel, int i)
-
Methods inherited from class com.brightcove.player.model.MetadataObject
getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty
-
Methods inherited from class android.os.Parcelable
describeContents, writeToParcel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
Video
Video(Map<String, Object> properties, Set<SourceCollection> sourceCollectionSet)
Initializes a new Video with a predefined metadata properties collection and apredefined Set of SourceCollection objects.- Parameters:
properties
- the metadata assigned to this instancesourceCollectionSet
- the collections of video asset sources to associate with this Video
-
Video
Video(Map<String, Object> properties, Set<SourceCollection> sourceCollectionSet, List<CuePoint> cuePoints)
Initializes a new Video with a predefined metadata properties collection, apredefined 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
-
-
Method Detail
-
getStatus
@NonNull() Video.Status getStatus()
Returns OK when the Video is valid and playable,or ERROR where there was an error while retrieving or creating the video.
-
getCuePoints
List<CuePoint> getCuePoints()
Retrieve a list of the cue points associated with this Video.
-
getDownloadId
@Nullable() UUID getDownloadId()
Gets the globally unique identifier to the local copy of this video, if any.
-
setDownloadId
void setDownloadId(@Nullable() UUID downloadId)
Sets the globally unique identifier to the local copy of this video, if any. This methodexists so that globally unique identifier can be accessed conveniently fromthe 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 globallyunique identifier.
-
getLicenseExpiryDate
@Nullable() Date getLicenseExpiryDate()
Gets the UTC date and time when the offline playback license for this video will expire.
-
setLicenseExpiryDate
void setLicenseExpiryDate(@Nullable() Date expiryDate)
Sets the UTC date and time when the offline playback license for this video is expected toexpire. Please note that changing this value here will not change the actual license expirydate. This method exists so that license expiry date can be accessed conveniently from theassociated 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.
-
fixProperties
Video fixProperties()
Ensures that the video properties to conform the expected value types.
-
detectDeliveryType
@NonNull() static DeliveryType detectDeliveryType(@NonNull() String uri)
Attempts to detect the delivery type of the asset URI provided.
- Parameters:
uri
- the asset uri
-
createVideo
static Video createVideo(@NonNull() String uri)
Creates a Video object from a string path. The video's delivery type will be set for URLswhose path end with .mp4 and .m3u(8). Otherwise it will be UNKNOWN.
- Parameters:
uri
- String URI to video
-
createVideo
static Video createVideo(@NonNull() String uri, Video.ProjectionFormat projectionFormat)
Creates a Video object from a string path. The video's delivery type will be set for URLswhose path end with .mp4 and .m3u(8). Otherwise it will be UNKNOWN.
- Parameters:
uri
- String URI to videoprojectionFormat
- the video projectionFormat
-
createVideo
static Video createVideo(@NonNull() String uri, DeliveryType type)
Creates a Video object from a string path.
- Parameters:
uri
- String URI to videotype
- DeliveryType
-
createVideo
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
-
getSourceCollections
Map<DeliveryType, SourceCollection> getSourceCollections()
Retrieve a Set of the SourceCollections associated with this Video.
-
getSourceCollectionByDeliveryType
@Nullable() SourceCollection getSourceCollectionByDeliveryType(DeliveryType deliveryType)
Retrieve the SourceCollection associated with this Video and the specified Delivery Type.It returns null if no SourceCollection was found.
-
findHighQualitySource
@Nullable() Source findHighQualitySource(@NonNull() DeliveryType deliveryType)
Finds the source with highest bitrate for the specified delivery type.
- Parameters:
deliveryType
- the delivery type.
-
findLowQualitySource
@Nullable() Source findLowQualitySource(@NonNull() DeliveryType deliveryType)
Finds the source with lowest bitrate for the specified delivery type.
- Parameters:
deliveryType
- the delivery type.
-
getId
@NonNull() String getId()
Convenience method for obtaining the parsed ID from the properties map.
-
getReferenceId
@NonNull() String getReferenceId()
Convenience method for obtaining the parsed reference identifier from the properties map.
-
getDuration
@Deprecated() int getDuration()
Convenience method for obtaining the parsed Duration value from the properties Map
-
getDurationLong
long getDurationLong()
Convenience method for obtaining the parsed Duration value from the properties Map
-
getProjectionFormat
@NonNull() Video.ProjectionFormat getProjectionFormat()
Gets the video format.
-
isVideo360
boolean isVideo360()
Checks if this is a 360 degree video.
-
isClearContent
boolean isClearContent()
Check if the video is DRM free content.
-
isOfflinePlaybackAllowed
final boolean isOfflinePlaybackAllowed()
Checks if the video can be stored locally on the host device. A video is considered storableif it has ODRM_PLAYBACK_ALLOWED flag set and has at least one DRM enabled source.
-
getName
@NonNull() String getName()
It gets the video name from the NAME video property if available,or an empty string otherwise.
-
getDescription
@NonNull() String getDescription()
It gets the video description from the SHORT_DESCRIPTION video property if available,or an empty string otherwise.
-
getLongDescription
@Nullable() String getLongDescription()
It gets the video's long description from the LONG_DESCRIPTION video property if available.
-
getStillImageUri
@Nullable() URI getStillImageUri()
It gets the URI from the STILL_IMAGE_URI video property if available,or null otherwise.
NOTE: It is recommended to use getPosterImage instead.
-
getPosterImage
@Nullable() URI getPosterImage()
Gets the poster image source.
It selects a source from the list of POSTER_SOURCES in the Video properties if available,giving preference to the HTTPS version of the poster source.
If the POSTER_SOURCES video property is not available, it will return the STILL_IMAGE_URI video property, or null otherwise.
-
getThumbnail
@Nullable() URI getThumbnail()
Gets the thumbnail image source.
It selects a source from the list of THUMBNAIL_SOURCES in the Video properties if available,giving preference to the HTTPS version of the thumbnail source.
If the THUMBNAIL_SOURCES video property is not available, it will return the THUMBNAIL video property, or null otherwise.
-
getPosterSources
@NonNull() Set<URI> getPosterSources()
Gets the list of poster sources.
It gets the list from the POSTER_SOURCES video property if available,or an empty list otherwise.
-
getThumbnailSources
@NonNull() Set<URI> getThumbnailSources()
Gets the list of thumbnail sources.
It gets the list from the THUMBNAIL_SOURCES video property if available,or an empty list otherwise.
-
isOwned
boolean isOwned()
Checks if the video has a valid purchase license.
-
isRented
boolean isRented()
Checks if the video has a valid rental license.
-
getOfflinePlaybackLicenseKey
@Nullable() Array<byte> getOfflinePlaybackLicenseKey()
Gets the key set identifier for the current offline playback license for this video, if any.
-
setOfflinePlaybackLicenseKey
void setOfflinePlaybackLicenseKey(@Nullable() Array<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 fromthe associated video object. Setting or clearing the license key set identifier directlyusing 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 thelicense key identifier.
-
isOfflineCopy
boolean isOfflineCopy()
Checks if this video is an offline copy, if and only if all of its sources are local.
-
getPreviewThumbnailSources
@NonNull() List<PreviewThumbnailFormat> getPreviewThumbnailSources()
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel parcel, int i)
-
-
-
-