public class TrackImpl extends AbstractMediaPackageElement implements Track
| Modifier and Type | Class and Description |
|---|---|
static class |
TrackImpl.Adapter |
static class |
TrackImpl.StreamingProtocol |
MediaPackageElement.Type| Modifier and Type | Field and Description |
|---|---|
protected List<AudioStream> |
audio |
protected Long |
duration
The duration in milliseconds
|
protected boolean |
live |
protected TrackImpl.StreamingProtocol |
transport |
protected List<VideoStream> |
video |
checksum, description, elementType, flavor, id, mediaPackage, mimeType, reference, size, tags, uri| Constructor and Description |
|---|
TrackImpl()
Needed by JAXB
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStream(AbstractStreamImpl stream)
Add a stream to the track.
|
static TrackImpl |
fromURI(URI uri)
Creates a new track from the given url.
|
List<AudioStream> |
getAudio() |
String |
getDescription()
This implementation returns the track's mime type.
|
Long |
getDuration()
Returns the track duration in milliseconds or
null if the duration is not available. |
Stream[] |
getStreams()
Return the streams that make up the track.
|
TrackImpl.StreamingProtocol |
getTransport() |
List<VideoStream> |
getVideo() |
boolean |
hasAudio()
Returns
true if the track features an audio stream. |
boolean |
hasVideo()
Returns
true if the track features a video stream. |
boolean |
isLive()
Returns
true if the track is a live track. |
void |
setAudio(List<AudioStream> audio) |
void |
setDuration(Long duration)
Sets the track's duration in milliseconds.
|
void |
setLive(boolean isLive) |
void |
setTransport(TrackImpl.StreamingProtocol transport) |
void |
setVideo(List<VideoStream> video) |
Node |
toManifest(Document document,
MediaPackageSerializer serializer)
This method returns an XML serialization of the object to be stored in the media package manifest.
|
addTag, clearReference, clearTags, clone, compareTo, containsTag, containsTag, equals, getChecksum, getElementDescription, getElementType, getFlavor, getIdentifier, getMediaPackage, getMimeType, getReference, getSize, getTags, getURI, hashCode, referTo, referTo, referTo, removeTag, setChecksum, setElementDescription, setFlavor, setIdentifier, setMimeType, setReference, setSize, setURI, toString, verifyfinalize, getClass, notify, notifyAll, wait, wait, waitaddTag, clearReference, clearTags, clone, containsTag, containsTag, getChecksum, getElementDescription, getElementType, getFlavor, getIdentifier, getMediaPackage, getMimeType, getReference, getSize, getTags, getURI, referTo, referTo, referTo, removeTag, setChecksum, setElementDescription, setFlavor, setIdentifier, setMimeType, setReference, setSize, setURI, verifycompareToprotected Long duration
protected List<AudioStream> audio
protected List<VideoStream> video
protected TrackImpl.StreamingProtocol transport
protected boolean live
public static TrackImpl fromURI(URI uri)
uri - the track locationpublic void setDuration(Long duration)
duration - the durationpublic Long getDuration()
Tracknull if the duration is not available.getDuration in interface TrackTrack.getDuration()public Stream[] getStreams()
TrackgetStreams in interface Trackpublic void addStream(AbstractStreamImpl stream)
public boolean hasAudio()
true if the track features an audio stream.hasAudio in interface Tracktrue if the track has an audio streamTrack.hasAudio()public boolean hasVideo()
true if the track features a video stream.hasVideo in interface Tracktrue if the track has a video streamTrack.hasVideo()public List<AudioStream> getAudio()
public void setAudio(List<AudioStream> audio)
public List<VideoStream> getVideo()
public void setVideo(List<VideoStream> video)
public void setLive(boolean isLive)
public boolean isLive()
Tracktrue if the track is a live track.isLive in interface TrackTrack.isLive()public Node toManifest(Document document, MediaPackageSerializer serializer) throws MediaPackageException
ManifestContributor
For creating MediaPackageElements from a manifest, please use
MediaPackageElementBuilder.elementFromManifest(org.w3c.dom.Node, MediaPackageSerializer). All other objects
shall provide their own implementation specific reconstruction mechanism.
toManifest in interface ManifestContributortoManifest in class AbstractMediaPackageElementdocument - the parentserializer - the media package serializerMediaPackageException - if the mediapackage can't be serializedAbstractMediaPackageElement.toManifest(org.w3c.dom.Document,
MediaPackageSerializer)public String getDescription()
getDescription in interface TrackTrack.getDescription()public void setTransport(TrackImpl.StreamingProtocol transport)
public TrackImpl.StreamingProtocol getTransport()
Copyright © 2009–2021 Opencast Project. All rights reserved.