Package com.brightcove.player.model
Class Source
java.lang.Object
com.brightcove.player.model.MetadataObject
com.brightcove.player.model.SourceAwareMetadataObject
com.brightcove.player.model.Source
- All Implemented Interfaces:
Serializable
The Source class is an immutable representation of a specific playable video asset, including
the URL or other necessary information required to play the video.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Provides the list of known field names that can appear in the properties Map. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The constant HLS EXT_X_VERSION_4.static final String
The constant HLS EXT_X_VERSION_5.Fields inherited from class com.brightcove.player.model.MetadataObject
properties, TAG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConvenience getter to retrieve the property with a key of BIT_RATEgetKeySystem
(String keySystem) Returns the specified key system, or an empty Map if the key system can not be foundstatic String
getSourceUrl
(Source source) Gets the URL of the source.getUrl()
Convenience getter to retrieve the property with theSource.Fields.URL
keyboolean
Checks if the source has HLSe encryption.boolean
hasKeySystem
(String keySystem) Checks if the source has the specified key system.boolean
isLocal()
Checks if the source points to local media.toString()
Methods inherited from class com.brightcove.player.model.SourceAwareMetadataObject
getDeliveryType, initializeDeliveryType
Methods inherited from class com.brightcove.player.model.MetadataObject
getIntegerProperty, getIntegerProperty, getLongProperty, getProperties, getStringProperty, getStringProperty
-
Field Details
-
EXT_X_VERSION_5
The constant HLS EXT_X_VERSION_5.- See Also:
-
EXT_X_VERSION_4
The constant HLS EXT_X_VERSION_4.- See Also:
-
-
Constructor Details
-
Source
- See Also:
-
Source
Initializes a Source with a single URL property.- Parameters:
url
- the URL for this Source asset
-
Source
Initializes a Source with a single URL property with the given DeliveryType.- Parameters:
url
- the URL for this Source assetdeliveryType
- the DeliveryType for the Source asset
-
-
Method Details
-
isLocal
public boolean isLocal()Checks if the source points to local media.- Returns:
- true if the source is local, otherwise false.
-
getUrl
Convenience getter to retrieve the property with theSource.Fields.URL
key- Returns:
- the URL property for this source
-
getBitRate
Convenience getter to retrieve the property with a key of BIT_RATE- Returns:
- the bit rate for this Source, or -1 if none specified
-
hasKeySystem
Checks if the source has the specified key system.- Parameters:
keySystem
- the unique identifier of the key systems, such asSource.Fields.WIDEVINE_KEY_SYSTEM
.- Returns:
- true if the source has the specified key system, otherwise false.
-
getKeySystem
Returns the specified key system, or an empty Map if the key system can not be found- Parameters:
keySystem
- the unique identifier of the key systems, such asSource.Fields.WIDEVINE_KEY_SYSTEM
.- Returns:
- the Map of the specified key system, or null.
-
hasHlseEncryption
public boolean hasHlseEncryption()Checks if the source has HLSe encryption.- Returns:
- true if the source has either: - An "encryption" property Map (for Live streams) or - "aes128" in the source URL (for VOD) - otherwise false.
-
getSourceUrl
Gets the URL of the source.- Parameters:
source
- the source.- Returns:
- null if the source is null or if the source url is null, otherwise the source url as a string value.
-
toString
- Overrides:
toString
in classMetadataObject
-