public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { if (!mediaPlaylist.isOngoing()) { tagWriter.writeTag(getTag()); } }
public void write(TagWriter tagWriter, Playlist playlist) { if (playlist.hasMediaPlaylist()) { KeyWriter keyWriter = new KeyWriter(); MapInfoWriter mapInfoWriter = new MapInfoWriter(); foreach (TrackData trackData in playlist.getMediaPlaylist().getTracks()) { if (trackData.hasDiscontinuity()) { tagWriter.writeTag(Constants.EXT_X_DISCONTINUITY_TAG); } keyWriter.writeTrackData(tagWriter, playlist, trackData); mapInfoWriter.writeTrackData(tagWriter, playlist, trackData); if (trackData.hasByteRange()) { writeByteRange(tagWriter, trackData.getByteRange()); } writeExtinf(tagWriter, playlist, trackData); tagWriter.writeLine(trackData.getUri()); } } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { if (mediaPlaylist.isIframesOnly()) { tagWriter.writeTag(getTag()); } }
public virtual void write(TagWriter tagWriter, Playlist playlist) { if (!hasData()) { tagWriter.writeTag(getTag()); } }
protected void writeAttributes <T>(TagWriter tagWriter, T attributes, Dictionary <String, AttributeWriter <T> > attributeWriters) { StringBuilder sb = new StringBuilder(); foreach (KeyValuePair <String, AttributeWriter <T> > entry in attributeWriters) { AttributeWriter <T> handler = entry.Value; String attribute = entry.Key; if (handler.containsAttribute(attributes)) { String value = null; try { value = handler.write(attributes); } catch (ParseException ex) { throw ParseException.create(ex.type, getTag(), ex.getMessageSuffix()); } sb.Append(attribute).Append(Constants.ATTRIBUTE_SEPARATOR).Append(value); sb.Append(Constants.ATTRIBUTE_LIST_SEPARATOR); } } sb.Remove(sb.Length - 1, 1); tagWriter.writeTag(getTag(), sb.ToString()); }
public override void write(TagWriter tagWriter, Playlist playlist) { if (playlist.hasMediaPlaylist()) { doWrite(tagWriter, playlist, playlist.getMediaPlaylist()); } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MasterPlaylist masterPlaylist) { foreach (IFrameStreamInfo streamInfo in masterPlaylist.getIFramePlaylists()) { writeAttributes(tagWriter, streamInfo, HANDLERS); } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { if (mediaPlaylist.getPlaylistType() != null) { tagWriter.writeTag(getTag(), mediaPlaylist.getPlaylistType().getValue()); } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { if (mediaPlaylist.hasStartData()) { StartData startData = mediaPlaylist.getStartData(); writeAttributes(tagWriter, startData, HANDLERS); } }
public Writer(Stream outputStream, Encoding encoding) { try { tagWriter = new TagWriter(new StreamWriter(outputStream, encoding.getValue())); } catch (Exception e) // TODO: Was UnsupportedEncodingException. c# equivalent? { throw new ArgumentException(e.Message, e); } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MasterPlaylist masterPlaylist) { foreach (PlaylistData playlistData in masterPlaylist.getPlaylists()) { if (playlistData.hasStreamInfo()) { writeAttributes(tagWriter, playlistData.getStreamInfo(), HANDLERS); tagWriter.writeLine(playlistData.getUri()); } } }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MasterPlaylist masterPlaylist) { if (masterPlaylist.getMediaData().Count > 0) { List <MediaData> mds = masterPlaylist.getMediaData(); foreach (MediaData md in mds) { writeAttributes(tagWriter, md, HANDLERS); } } }
public void writeTrackData(TagWriter tagWriter, Playlist playlist, TrackData trackData) { if (trackData != null && trackData.getMapInfo() != null) { MapInfo mapInfo = trackData.getMapInfo(); if (!mapInfo.Equals(mMapInfo)) { mMapInfo = mapInfo; write(tagWriter, playlist); } } }
public void writeTrackData(TagWriter tagWriter, Playlist playlist, TrackData trackData) { if (trackData != null && trackData.hasEncryptionData()) { EncryptionData encryptionData = trackData.getEncryptionData(); if (!encryptionData.Equals(mEncryptionData)) { mEncryptionData = encryptionData; write(tagWriter, playlist); } } }
private static void writeByteRange(TagWriter tagWriter, ByteRange byteRange) { String value; if (byteRange.getOffset() != null) { value = byteRange.getSubRangeLength().ToString() + '@' + byteRange.getOffset().ToString(); } else { value = byteRange.getSubRangeLength().ToString(); } tagWriter.writeTag(Constants.EXT_X_BYTERANGE_TAG, value); }
public override void write(TagWriter tagWriter, Playlist playlist) { List <String> unknownTags; if (playlist.hasMasterPlaylist() && playlist.getMasterPlaylist().hasUnknownTags()) { unknownTags = playlist.getMasterPlaylist().getUnknownTags(); } else if (playlist.getMediaPlaylist().hasUnknownTags()) { unknownTags = playlist.getMediaPlaylist().getUnknownTags(); } else { unknownTags = new List <String>(); } foreach (String line in unknownTags) { tagWriter.writeLine(line); } }
private static void writeExtinf(TagWriter tagWriter, Playlist playlist, TrackData trackData) { StringBuilder builder = new StringBuilder(); if (playlist.getCompatibilityVersion() < 3) { builder.Append(((int)trackData.getTrackInfo().duration).ToString()); } else { builder.Append(trackData.getTrackInfo().duration.ToString()); } if (!string.IsNullOrEmpty(trackData.getTrackInfo().title)) { builder.Append(Constants.COMMA); builder.Append(trackData.getTrackInfo().title); } tagWriter.writeTag(Constants.EXTINF_TAG, builder.ToString()); }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { // deprecated }
public override void write(TagWriter tagWriter, Playlist playlist) { tagWriter.writeTag(getTag(), playlist.getCompatibilityVersion().ToString()); }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { writeAttributes(tagWriter, mMapInfo, HANDLERS); }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { writeAttributes(tagWriter, mEncryptionData, HANDLERS); }
public virtual void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { tagWriter.writeTag(getTag()); }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { tagWriter.writeTag(getTag(), mediaPlaylist.getTargetDuration().ToString()); }
public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist) { tagWriter.writeTag(getTag(), mediaPlaylist.getMediaSequenceNumber().ToString()); }