Class SmilUtil
- java.lang.Object
-
- org.opencastproject.smil.api.util.SmilUtil
-
public final class SmilUtil extends Object
General purpose utility functions for dealing with SMIL.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSmilUtil.TrackType
-
Field Summary
Fields Modifier and Type Field Description static StringSMIL_NODE_NAMEstatic StringSMIL_NS_URI
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DocumentaddTrack(Document smilDocument, SmilUtil.TrackType trackType, boolean hasVideo, long startTime, long duration, URI uri, String trackId)Adds a track to the SMIL document.static DocumentcreateSmil()Creates a skeleton SMIL documentstatic org.w3c.dom.smil.SMILDocumentgetSmilDocumentFromMediaPackage(org.opencastproject.mediapackage.MediaPackage mp, org.opencastproject.mediapackage.MediaPackageElementFlavor smilFlavor, org.opencastproject.workspace.api.Workspace workspace)static DocumentloadSmilDocument(InputStream in, org.opencastproject.mediapackage.MediaPackageElement mpe)Load the SMIL document identified bympe.
-
-
-
Field Detail
-
SMIL_NODE_NAME
public static final String SMIL_NODE_NAME
- See Also:
- Constant Field Values
-
SMIL_NS_URI
public static final String SMIL_NS_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadSmilDocument
public static Document loadSmilDocument(InputStream in, org.opencastproject.mediapackage.MediaPackageElement mpe)
Load the SMIL document identified bympe. Throws an exception if it does not exist or cannot be loaded by any reason.- Returns:
- the document
-
createSmil
public static Document createSmil()
Creates a skeleton SMIL document- Returns:
- the SMIL document
-
addTrack
public static Document addTrack(Document smilDocument, SmilUtil.TrackType trackType, boolean hasVideo, long startTime, long duration, URI uri, String trackId)
Adds a track to the SMIL document.- Parameters:
smilDocument- the SMIL documenttrackType- the track typehasVideo- whether the track has a video streamstartTime- the start timeduration- the durationuri- the track URItrackId- the Id of the track- Returns:
- the augmented SMIL document
-
getSmilDocumentFromMediaPackage
public static org.w3c.dom.smil.SMILDocument getSmilDocumentFromMediaPackage(org.opencastproject.mediapackage.MediaPackage mp, org.opencastproject.mediapackage.MediaPackageElementFlavor smilFlavor, org.opencastproject.workspace.api.Workspace workspace) throws IOException, SAXException, org.opencastproject.util.NotFoundException- Throws:
IOExceptionSAXExceptionorg.opencastproject.util.NotFoundException
-
-