public class Video extends MetadataObject implements android.os.Parcelable
Modifier and Type | Class and Description |
---|---|
static class |
Video.Builder
Convenience Builder to build Video objects.
|
static interface |
Video.CanSetDownloadIdentifier
Any method attempting to call
setDownloadId(UUID) must be annotated explicitly with
this annotation. |
static interface |
Video.CanSetLicenseExpiryDate
Any method attempting to call
setLicenseExpiryDate(Date) must be annotated explicitly
with this annotation. |
static interface |
Video.CanSetLicenseKeySetId
Any method attempting to call
setOfflinePlaybackLicenseKey(byte[]) must be annotated
explicitly with this annotation. |
static class |
Video.Fields
Provides the list of known field names that can appear in the properties Map.
|
static class |
Video.ProjectionFormat
The list of known projection formats.
|
static class |
Video.Status |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<Video> |
CREATOR
Creator for de-serializing Video object from the given
Parcel . |
static int |
DEFAULT_LIVE_VIDEO_DURATION
Represent the default duration for a Live Video.
|
static int |
DEFAULT_REMOTE_VIDEO_DURATION
Represent the default duration for a Remote Video (including Remote Live Videos).
|
static int |
PARCEL_OBJECT_TYPE
The type of the parcelable object.
|
properties, TAG
Constructor and Description |
---|
Video(java.util.Map<java.lang.String,java.lang.Object> properties) |
Video(java.util.Map<java.lang.String,java.lang.Object> properties,
java.util.Set<SourceCollection> sourceCollectionSet)
Initializes a new Video with a predefined metadata properties collection and a
predefined Set of SourceCollection objects.
|
Video(java.util.Map<java.lang.String,java.lang.Object> properties,
java.util.Set<SourceCollection> sourceCollectionSet,
java.util.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.
|
Modifier and Type | Method and Description |
---|---|
static Video |
createVideo(java.lang.String uri)
Creates a Video object from a string path.
|
static Video |
createVideo(java.lang.String uri,
DeliveryType type)
Creates a Video object from a string path.
|
static Video |
createVideo(java.lang.String uri,
DeliveryType type,
Video.ProjectionFormat projectionFormat)
Creates a Video object from a string path.
|
static Video |
createVideo(java.lang.String uri,
Video.ProjectionFormat projectionFormat)
Creates a Video object from a string path.
|
int |
describeContents() |
static DeliveryType |
detectDeliveryType(java.lang.String uri)
Attempts to detect the delivery type of the asset URI provided.
|
Source |
findHighQualitySource(DeliveryType deliveryType)
Finds the source with highest bitrate for the specified delivery type.
|
Source |
findLowQualitySource(DeliveryType deliveryType)
Finds the source with lowest bitrate for the specified delivery type.
|
Video |
fixProperties()
Ensures that the video properties to conform the expected value types.
|
java.util.List<CuePoint> |
getCuePoints()
Retrieve a list of the cue points associated with this Video.
|
java.lang.String |
getDescription()
It gets the video description from the
Video.Fields.SHORT_DESCRIPTION video property if available,
or an empty string otherwise. |
java.util.UUID |
getDownloadId()
Gets the globally unique identifier to the local copy of this video, if any.
|
int |
getDuration()
Convenience method for obtaining the parsed Duration value from the properties Map
|
java.lang.String |
getId()
Convenience method for obtaining the parsed ID from the properties map.
|
java.util.Date |
getLicenseExpiryDate()
Gets the UTC date and time when the offline playback license for this video will expire.
|
java.lang.String |
getLongDescription()
It gets the video's long description from the
Video.Fields.LONG_DESCRIPTION video property if available. |
java.lang.String |
getName()
It gets the video name from the
Video.Fields.NAME video property if available,
or an empty string otherwise. |
byte[] |
getOfflinePlaybackLicenseKey()
Gets the key set identifier for the current offline playback license for this video, if any.
|
java.net.URI |
getPosterImage()
Gets the poster image source.
|
java.util.Set<java.net.URI> |
getPosterSources()
Gets the list of poster sources.
|
java.util.List<PreviewThumbnailFormat> |
getPreviewThumbnailSources() |
Video.ProjectionFormat |
getProjectionFormat()
Gets the video format.
|
java.lang.String |
getReferenceId()
Convenience method for obtaining the parsed reference identifier from the properties map.
|
SourceCollection |
getSourceCollectionByDeliveryType(DeliveryType deliveryType)
Retrieve the SourceCollection associated with this Video and the specified Delivery Type.
|
java.util.Map<DeliveryType,SourceCollection> |
getSourceCollections()
Retrieve a Set of the SourceCollections associated with this Video.
|
Video.Status |
getStatus()
Returns
Video.Status.OK when the Video is valid and playable,
or Video.Status.ERROR where there was an error while retrieving or creating the video. |
java.net.URI |
getStillImageUri()
It gets the
URI from the Video.Fields.STILL_IMAGE_URI video property if available,
or null otherwise. |
java.net.URI |
getThumbnail()
Gets the thumbnail image source.
|
java.util.Set<java.net.URI> |
getThumbnailSources()
Gets the list of thumbnail sources.
|
boolean |
isClearContent()
Check if the video is DRM free content.
|
boolean |
isOfflineCopy()
Checks if this video is an offline copy, if and only if all of its sources are local.
|
boolean |
isOfflinePlaybackAllowed()
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 |
isVideo360()
Checks if this is a 360 degree video.
|
void |
setDownloadId(java.util.UUID downloadId)
Sets the globally unique identifier to the local copy of this video, if any.
|
void |
setLicenseExpiryDate(java.util.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.
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel parcel,
int i) |
getIntegerProperty, getIntegerProperty, getProperties, getStringProperty, getStringProperty
public static final int DEFAULT_LIVE_VIDEO_DURATION
public static final int DEFAULT_REMOTE_VIDEO_DURATION
public static final int PARCEL_OBJECT_TYPE
public static android.os.Parcelable.Creator<Video> CREATOR
Parcel
.public Video(java.util.Map<java.lang.String,java.lang.Object> properties)
public Video(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<SourceCollection> sourceCollectionSet)
properties
- the metadata assigned to this instancesourceCollectionSet
- the collections of video asset sources to associate with this Videojava.lang.IllegalArgumentException
- if either or both arguments are nullpublic Video(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<SourceCollection> sourceCollectionSet, java.util.List<CuePoint> cuePoints)
properties
- the metadata assigned to this instancesourceCollectionSet
- the collections of video asset sources to associate with this Videojava.lang.IllegalArgumentException
- if either or both arguments are null@NonNull public Video.Status getStatus()
Video.Status.OK
when the Video is valid and playable,
or Video.Status.ERROR
where there was an error while retrieving or creating the video.Video.Status
public Video fixProperties()
@NonNull public static DeliveryType detectDeliveryType(@NonNull java.lang.String uri)
uri
- the asset uripublic static Video createVideo(@NonNull java.lang.String uri)
uri
- String URI to videopublic static Video createVideo(@NonNull java.lang.String uri, Video.ProjectionFormat projectionFormat)
uri
- String URI to videoprojectionFormat
- the video projectionFormatpublic static Video createVideo(@NonNull java.lang.String uri, DeliveryType type)
uri
- String URI to videotype
- DeliveryTypepublic static Video createVideo(@NonNull java.lang.String uri, @Nullable DeliveryType type, @Nullable Video.ProjectionFormat projectionFormat)
uri
- String URI to videotype
- DeliveryTypeprojectionFormat
- the projection formatpublic java.util.List<CuePoint> getCuePoints()
public java.util.Map<DeliveryType,SourceCollection> getSourceCollections()
@Nullable public SourceCollection getSourceCollectionByDeliveryType(DeliveryType deliveryType)
@Nullable public Source findHighQualitySource(@NonNull DeliveryType deliveryType)
deliveryType
- the delivery type.@Nullable public Source findLowQualitySource(@NonNull DeliveryType deliveryType)
deliveryType
- the delivery type.public java.lang.String toString()
toString
in class MetadataObject
@NonNull public java.lang.String getId()
@NonNull public java.lang.String getReferenceId()
public int getDuration()
@NonNull public Video.ProjectionFormat getProjectionFormat()
Video.ProjectionFormat.NORMAL
public boolean isVideo360()
public boolean isClearContent()
public final boolean isOfflinePlaybackAllowed()
Video.Fields.ODRM_PLAYBACK_ALLOWED
flag set and has at least one DRM enabled source.@NonNull public java.lang.String getName()
Video.Fields.NAME
video property if available,
or an empty string otherwise.@NonNull public java.lang.String getDescription()
Video.Fields.SHORT_DESCRIPTION
video property if available,
or an empty string otherwise.@Nullable public java.lang.String getLongDescription()
Video.Fields.LONG_DESCRIPTION
video property if available.@Nullable public java.net.URI getStillImageUri()
URI
from the Video.Fields.STILL_IMAGE_URI
video property if available,
or null otherwise.
NOTE: It is recommended to use getPosterImage()
instead.getPosterImage()
@Nullable public java.net.URI getPosterImage()
Video.Fields.POSTER_SOURCES
in the Video properties if available,
giving preference to the HTTPS version of the poster source.
If the Video.Fields.POSTER_SOURCES
video property is not available, it will return the
Video.Fields.STILL_IMAGE_URI
video property, or null otherwise.@Nullable public java.net.URI getThumbnail()
Video.Fields.THUMBNAIL_SOURCES
in the Video properties if available,
giving preference to the HTTPS version of the thumbnail source.
If the Video.Fields.THUMBNAIL_SOURCES
video property is not available, it will return the
Video.Fields.THUMBNAIL
video property, or null otherwise.@NonNull public java.util.Set<java.net.URI> getPosterSources()
Video.Fields.POSTER_SOURCES
video property if available,
or an empty list otherwise.@NonNull public java.util.Set<java.net.URI> getThumbnailSources()
Video.Fields.THUMBNAIL_SOURCES
video property if available,
or an empty list otherwise.public boolean isOwned()
public boolean isRented()
@Nullable public java.util.UUID getDownloadId()
public void setDownloadId(@Nullable java.util.UUID downloadId)
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.
downloadId
- null if there is no local copy of the video, otherwise the globally
unique identifier.java.lang.UnsupportedOperationException
- if the caller is not permitted to call this method.@Nullable public byte[] getOfflinePlaybackLicenseKey()
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.
licenseKeySetId
- null if the video has no offline playback license, otherwise the
license key identifier.java.lang.UnsupportedOperationException
- if the caller is not permitted to call this method.@Nullable public java.util.Date getLicenseExpiryDate()
public void setLicenseExpiryDate(@Nullable java.util.Date expiryDate)
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.
expiryDate
- null if the video has no offline playback license, otherwise the date.java.lang.UnsupportedOperationException
- if the caller is not permitted to call this method.public boolean isOfflineCopy()
Source.isLocal()
@NonNull public java.util.List<PreviewThumbnailFormat> getPreviewThumbnailSources()
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel parcel, int i)
writeToParcel
in interface android.os.Parcelable