Interface SmilService


public interface SmilService
SmilService provides Smil manipulation.
  • Method Details

    • createNewSmil

      SmilResponse createNewSmil()
      Create a new Smil.
      Returns:
      a new Smil
    • createNewSmil

      SmilResponse createNewSmil(org.opencastproject.mediapackage.MediaPackage mediaPackage)
      Create a new Smil and store the MediaPackage Id as meta data.
      Parameters:
      mediaPackage -
      Returns:
      a new Smil
    • addParallel

      SmilResponse addParallel(Smil smil) throws SmilException
      Add new par element to Smil.
      Parameters:
      smil - Smil to edit
      Returns:
      edited Smil and the new SmilMediaContainer
      Throws:
      SmilException
    • addParallel

      SmilResponse addParallel(Smil smil, String parentId) throws SmilException
      Add new par element to Smil inside an element with given Id.
      Parameters:
      smil - Smil to edit
      parentId - element id, where to add new par element
      Returns:
      edited Smil and the new SmilMediaContainer
      Throws:
      SmilException - if there is no element with given parentId
    • addSequence

      SmilResponse addSequence(Smil smil) throws SmilException
      Add new seq element to Smil.
      Parameters:
      smil - Smil to edit
      Returns:
      edited Smil and the new SmilMediaContainer
      Throws:
      SmilException
    • addSequence

      SmilResponse addSequence(Smil smil, String parentId) throws SmilException
      Add new seq element to Smil inside an element with given Id.
      Parameters:
      smil - Smil to edit
      parentId - element id, where to add new seq element
      Returns:
      edited Smil and the new SmilMediaContainer
      Throws:
      SmilException - if there is no element with given parentId
    • addClip

      SmilResponse addClip(Smil smil, String parentId, org.opencastproject.mediapackage.Track track, long start, long duration) throws SmilException
      Add a SmilMediaElement based on given track and start/duration information.
      Parameters:
      smil - Smil to edit
      parentId - element id, where to add new SmilMediaElement
      track - Track to add as SmilMediaElement
      start - start position in Track in milliseconds
      duration - 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

      SmilResponse addClip(Smil smil, String parentId, org.opencastproject.mediapackage.Track track, long start, long duration, String paramGroupId) throws SmilException
      Add a SmilMediaElement based on given track and start/duration information.
      Parameters:
      smil - Smil to edit
      parentId - element id, where to add new SmilMediaElement
      track - Track to add as SmilMediaElement
      start - start position in Track in milliseconds
      duration - duration in milliseconds
      paramGroupId - 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

      SmilResponse addClips(Smil smil, String parentId, org.opencastproject.mediapackage.Track[] tracks, long start, long duration) throws SmilException
      Add a list of SmilMediaElements based on given tracks and start/duration information.
      Parameters:
      smil - Smil to edit
      parentId - element id, where to add new SmilMediaElements
      tracks - Tracks to add as SmilMediaElements
      start - start position in Tracks in milliseconds
      duration - 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

      SmilResponse addMeta(Smil smil, String name, String content)
      Add a meta element to Smil head.
      Parameters:
      smil - Smil to edit
      name - meta name
      content - meta content
      Returns:
      edited Smil and the new SmilMeta
    • removeSmilElement

      SmilResponse removeSmilElement(Smil smil, String elementId)
      Remove element (identified by elementId) from Smil if exists.
      Parameters:
      smil - Smil to edit
      elementId - element Id to remove
      Returns:
      edited Smil and removed SmilMediaElement if Smil contains an element with given Id
    • fromXml

      SmilResponse fromXml(String smilXml) throws SmilException
      Returns Smil from Xml String.
      Parameters:
      smilXml - Smil document Xml as String
      Returns:
      parsed Smil
      Throws:
      SmilException - if an error occures while parsing Smil
    • fromXml

      SmilResponse fromXml(File smilXmlFile) throws SmilException
      Returns Smil from Xml File.
      Parameters:
      smilXmlFile - Smil document Xml as File
      Returns:
      parsed Smil
      Throws:
      SmilException - if an error occures while parsing Smil