Package org.opencastproject.smil.impl
Class SmilServiceImpl
java.lang.Object
org.opencastproject.smil.impl.SmilServiceImpl
- All Implemented Interfaces:
SmilService
Implement
SmilService interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a SmilMediaElement based on given track and start/duration information.Add a SmilMediaElement based on given track and start/duration information.Add a list of SmilMediaElements based on given tracks and start/duration information.Add a meta element toSmilhead.addParallel(Smil smil) Add new par element toSmil.addParallel(Smil smil, String parentId) Add new par element toSmilinside an element with given Id.addSequence(Smil smil) Add new seq element toSmil.addSequence(Smil smil, String parentId) Add new seq element toSmilinside an element with given Id.Create a newSmil.createNewSmil(MediaPackage mediaPackage) Create a newSmiland store theMediaPackageId as meta data.ReturnsSmilfrom XmlFile.ReturnsSmilfrom XmlString.removeSmilElement(Smil smil, String elementId) Remove element (identified by elementId) fromSmilif exists.
-
Constructor Details
-
SmilServiceImpl
public SmilServiceImpl()
-
-
Method Details
-
createNewSmil
Create a newSmil.- Specified by:
createNewSmilin interfaceSmilService- Returns:
- a new
Smil
-
createNewSmil
Create a newSmiland store theMediaPackageId as meta data.- Specified by:
createNewSmilin interfaceSmilService- Parameters:
mediaPackage-- Returns:
- a new
Smil
-
addParallel
Add new par element toSmil.- Specified by:
addParallelin interfaceSmilService- Parameters:
smil-Smilto edit- Returns:
- edited
Smiland the new SmilMediaContainer - Throws:
SmilException
-
addParallel
Add new par element toSmilinside an element with given Id.- Specified by:
addParallelin interfaceSmilService- Parameters:
smil-Smilto editparentId- element id, where to add new par element- Returns:
- edited
Smiland the new SmilMediaContainer - Throws:
SmilException- if there is no element with given parentId
-
addSequence
Add new seq element toSmil.- Specified by:
addSequencein interfaceSmilService- Parameters:
smil-Smilto edit- Returns:
- edited
Smiland the new SmilMediaContainer - Throws:
SmilException
-
addSequence
Add new seq element toSmilinside an element with given Id.- Specified by:
addSequencein interfaceSmilService- Parameters:
smil-Smilto editparentId- element id, where to add new seq element- Returns:
- edited
Smiland the new SmilMediaContainer - Throws:
SmilException- if there is no element with given parentId
-
addClip
public SmilResponse addClip(Smil smil, String parentId, Track track, long start, long duration) throws SmilException Description copied from interface:SmilServiceAdd a SmilMediaElement based on given track and start/duration information.- Specified by:
addClipin interfaceSmilService- Parameters:
smil-Smilto editparentId- element id, where to add new SmilMediaElementtrack-Trackto add as SmilMediaElementstart- start position inTrackin millisecondsduration- duration in milliseconds- Returns:
- edited
Smil, the new SmilMediaElement and generated meta data - Throws:
SmilException- if there is no element with the given parentId
-
addClip
public SmilResponse addClip(Smil smil, String parentId, Track track, long start, long duration, String pgId) throws SmilException Add a SmilMediaElement based on given track and start/duration information.- Specified by:
addClipin interfaceSmilService- Parameters:
smil-Smilto editparentId- element id, where to add new SmilMediaElementtrack-Trackto add as SmilMediaElementstart- start position inTrackin millisecondsduration- duration in millisecondspgId- clip should be added as a part of a previously created param group- Returns:
- edited
Smil, the new SmilMediaElement and generated meta data - Throws:
SmilException- if there is no element with the given parentId
-
addClips
public SmilResponse addClips(Smil smil, String parentId, Track[] tracks, long start, long duration) throws SmilException Add a list of SmilMediaElements based on given tracks and start/duration information.- Specified by:
addClipsin interfaceSmilService- Parameters:
smil-Smilto editparentId- element id, where to add new SmilMediaElementstracks-Tracks to add as SmilMediaElementsstart- start position inTracks in millisecondsduration- duration in milliseconds- Returns:
- edited
Smil, the new SmilMediaElements and tracks meta data - Throws:
SmilException- if there is no element with the given parentId
-
addMeta
Add a meta element toSmilhead.- Specified by:
addMetain interfaceSmilService- Parameters:
smil-Smilto editname- meta namecontent- meta content- Returns:
- edited
Smiland the new SmilMeta
-
removeSmilElement
Remove element (identified by elementId) fromSmilif exists.- Specified by:
removeSmilElementin interfaceSmilService- Parameters:
smil-Smilto editelementId- element Id to remove- Returns:
- edited Smil and removed SmilMediaElement if
Smilcontains an element with given Id
-
fromXml
ReturnsSmilfrom XmlString.- Specified by:
fromXmlin interfaceSmilService- Parameters:
smilXml- Smil document Xml asString- Returns:
- parsed
Smil - Throws:
SmilException- if an error occures while parsingSmil
-
fromXml
ReturnsSmilfrom XmlFile.- Specified by:
fromXmlin interfaceSmilService- Parameters:
smilXmlFile- Smil document Xml asFile- Returns:
- parsed
Smil - Throws:
SmilException- if an error occures while parsingSmil
-