Class MasterPlaylistParser

java.lang.Object

public class MasterPlaylistParser
extends AbstractPlaylistParser<MasterPlaylist,​MasterPlaylist.Builder>
MasterPlaylistParser can read and write Master Playlists according to RFC 8216 (HTTP Live Streaming).

Example usage:

 
 MasterPlaylistParser parser = new MasterPlaylistParser();

 // Parse playlist
 MasterPlaylist playlist = parser.readPlaylist(Paths.get("path/to/master.m3u8"));

 // Update playlist version
 MasterPlaylist updated = MasterPlaylist.builder()
                                        .from(playlist)
                                        .version(2)
                                        .build();

 // Write playlist to standard out
 System.out.println(parser.writePlaylistAsString(updated));
 
 
This implementation is reusable and thread safe.
  • Constructor Details

    • MasterPlaylistParser

      public MasterPlaylistParser()
    • MasterPlaylistParser

      public MasterPlaylistParser​(ParsingMode parsingMode)