Class MediaPlaylist

  • All Implemented Interfaces:
    Cloneable

    public class MediaPlaylist
    extends ManifestModel
    Provides implementation of HLS media playlists This class is not thread safe.
    • Constructor Detail

      • MediaPlaylist

        public MediaPlaylist()
    • Method Detail

      • doSubs

        public void doSubs​(java.util.Map<String,​Object> params,
                           IHTTPStreamerSession httpStreamerSession,
                           IHTTPRequest req,
                           com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.HTTPStreamerAdapterCupertinoStreamer.RequestInfo requestInfo)
        Description copied from class: ManifestModel
        Does variable replacement within the manifest model based on http request coming in
        Overrides:
        doSubs in class ManifestModel
      • setContextStr

        public void setContextStr​(String context)
        Specific to Playlist reader to set the context in which the playlist is reading. Intent would be this would be the Source stream name to associate the log entries with
        Parameters:
        context - context of the reader
      • getPlaylistCount

        public int getPlaylistCount()
        Returns:
        the playlistCount
      • setPlaylistCount

        public void setPlaylistCount​(int playlistCount)
        Parameters:
        playlistCount - the playlistCount to set
      • addTag

        public TagModel addTag​(TagModel tag)
        Add a tag to the playlist model and propagate context and debug settings
        Parameters:
        tag - to be added to the playlist model
        Returns:
        tag
      • addAllTags

        public void addAllTags​(java.util.Collection<? extends TagModel> tags)
        Add a list of tags to the MediaPlaylist and propagate context and debug settings
        Parameters:
        tags - - list of tags to be added to the playlist model
      • logTags

        public void logTags()
      • updateMediaPlaylistTags

        public void updateMediaPlaylistTags​(java.util.Collection<? extends TagModel> tagsToUpdate)
        Update a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist. It is assumed that both the list of tags provided and the list of tags in the current MediaPlaylist contain no repeated tags (i.e. no more than one of any one TagModel type), as should be the case for Media Playlist tags. Media Segment tags should not be included since those are stored in the segment entries themselves.
        Parameters:
        tagsToUpdate -
      • removeMediaPlaylistTags

        public void removeMediaPlaylistTags​(java.util.Collection<? extends TagModel> tagsToRemove)
        Remove a list of "Media Playlist Tags" (as defined by the Apple spec) in the MediaPlaylist. It is assumed that both the list of tags provided and the list of tags in the current MediaPlaylist contain no repeated tags (i.e. no more than one of any one TagModel type), as should be the case for Media Playlist tags. Media Segment tags should not be included since those are stored in the segment entries themselves.
        Parameters:
        tagsToRemove -
      • addSegment

        public void addSegment​(Segment segment,
                               long segmentId)
        Add a new segment to the end of the segment list. If the list exceeds the maximum number of segments, the first segment in the list is removed.
        Parameters:
        segment - - new segment to add. Should be fully setup before calling this method
      • skipSegments

        public void skipSegments​(Float duration)
        Trims segments off the beginning of the list to the point that the duration of the remaining segments is @duration or slightly over
        Parameters:
        duration - the minimum length of remaining segments.
      • addRenditionReportTags

        public void addRenditionReportTags​(java.util.Collection<TagModelRenditionReport> renditionReports)
        Adds EXT-X-RENDITION-REPORT tags. This can only be called from a request context where the ABR groupings are known.
        Parameters:
        renditionReports - - ordered list of the variant rendition report tag models to add.
      • getLastSegmentPart

        public SegmentPartId getLastSegmentPart()
        Retrieves the last segment's media sequence number and its last partial segment number (if any).
        Returns:
        the segment/part Id
      • getPartTag

        public TagModelPartialSegment getPartTag​(long segmentIndex,
                                                 long partIndex)
        Retrieves a partial segment tag.
        Returns:
        the tag
      • getMapTag

        public TagModelMap getMapTag​(long segmentIndex,
                                     long partIndex)
        Retrieves a partial segment tag.
        Returns:
        the tag
      • clone

        public Object clone()
                     throws CloneNotSupportedException
        Overrides:
        clone in class ManifestModelLogging
        Throws:
        CloneNotSupportedException
      • write

        public void write​(TagWriter tagWriter)
                   throws java.io.IOException
        Specified by:
        write in class ManifestModel
        Throws:
        java.io.IOException
      • getTags

        public java.util.Collection<TagModel> getTags()
      • findTag

        public <T extends TagModel> T findTag​(Class<T> tagType)
      • getSegments

        public java.util.TreeMap<Long,​Segment> getSegments()