Class VideoStream.Builder
- Enclosing class:
- VideoStream
VideoStream objects.-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Create a newVideoStream.Builderinstance with its default values. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build aVideoStreamusing the builder's current values.setContent(String content, boolean isUrl) Set the content of theVideoStream.setDeliveryMethod(DeliveryMethod deliveryMethod) Set theDeliveryMethodof theVideoStream.Set the identifier of theVideoStream.setIsVideoOnly(boolean isVideoOnly) Set whether theVideoStreamis video-only.setItagItem(ItagItem itagItem) Set theItagItemcorresponding to theVideoStream.setManifestUrl(String manifestUrl) Sets the URL of the manifest this stream comes from (if applicable, otherwise null).setMediaFormat(MediaFormat mediaFormat) Set theMediaFormatused by theVideoStream.setResolution(String resolution) Set the resolution of theVideoStream.
-
Constructor Details
-
Builder
public Builder()Create a newVideoStream.Builderinstance with its default values.
-
-
Method Details
-
setId
Set the identifier of theVideoStream.It must not be null, and should be non empty.
If you are not able to get an identifier, use the static constant
ID_UNKNOWNof theStreamclass.- Parameters:
id- the identifier of theVideoStream, which must not be null- Returns:
- this
VideoStream.Builderinstance
-
setContent
Set the content of theVideoStream.It must not be null, and should be non empty.
- Parameters:
content- the content of theVideoStreamisUrl- whether the content is a URL- Returns:
- this
VideoStream.Builderinstance
-
setMediaFormat
Set theMediaFormatused by theVideoStream.It should be one of the video
MediaFormats (MPEG_4,v3GPP, orWEBM) but can benullif the media format could not be determined.The default value is
null.- Parameters:
mediaFormat- theMediaFormatof theVideoStream, which can be null- Returns:
- this
VideoStream.Builderinstance
-
setDeliveryMethod
Set theDeliveryMethodof theVideoStream.It must not be null.
The default delivery method is
DeliveryMethod.PROGRESSIVE_HTTP.- Parameters:
deliveryMethod- theDeliveryMethodof theVideoStream, which must not be null- Returns:
- this
VideoStream.Builderinstance
-
setManifestUrl
Sets the URL of the manifest this stream comes from (if applicable, otherwise null).- Parameters:
manifestUrl- the URL of the manifest this stream comes from ornull- Returns:
- this
VideoStream.Builderinstance
-
setIsVideoOnly
Set whether theVideoStreamis video-only.This property must be set before building the
VideoStream.- Parameters:
isVideoOnly- whether theVideoStreamis video-only- Returns:
- this
VideoStream.Builderinstance
-
setResolution
Set the resolution of theVideoStream.This resolution can be used by clients to know the quality of the video stream.
If you are not able to know the resolution, you should use
VideoStream.RESOLUTION_UNKNOWNas the resolution of the video stream.It must be set before building the builder and not null.
- Parameters:
resolution- the resolution of theVideoStream- Returns:
- this
VideoStream.Builderinstance
-
setItagItem
Set theItagItemcorresponding to theVideoStream.ItagItems are YouTube specific objects, so they are only known for this service and can be null.The default value is
null.- Parameters:
itagItem- theItagItemof theVideoStream, which can be null- Returns:
- this
VideoStream.Builderinstance
-
build
Build aVideoStreamusing the builder's current values.The identifier, the content (and so the
isUrlboolean), theisVideoOnlyand theresolutionproperties must have been set.- Returns:
- a new
VideoStreamusing the builder's current values - Throws:
IllegalStateException- ifid,content(and soisUrl),deliveryMethod,isVideoOnlyorresolutionhave been not set, or have been set asnull
-