Exemplo n.º 1
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     if (mediaPlaylist.getPlaylistType() != null)
     {
         tagWriter.writeTag(getTag(), mediaPlaylist.getPlaylistType().getValue());
     }
 }
Exemplo n.º 2
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     if (!mediaPlaylist.isOngoing())
     {
         tagWriter.writeTag(getTag());
     }
 }
Exemplo n.º 3
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     if (mediaPlaylist.isIframesOnly())
     {
         tagWriter.writeTag(getTag());
     }
 }
Exemplo n.º 4
0
 private Playlist(MasterPlaylist masterPlaylist, MediaPlaylist mediaPlaylist, bool isExtended, int compatibilityVersion)
 {
     mMasterPlaylist       = masterPlaylist;
     mMediaPlaylist        = mediaPlaylist;
     mIsExtended           = isExtended;
     mCompatibilityVersion = compatibilityVersion;
 }
Exemplo n.º 5
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     if (mediaPlaylist.hasStartData())
     {
         StartData startData = mediaPlaylist.getStartData();
         writeAttributes(tagWriter, startData, HANDLERS);
     }
 }
Exemplo n.º 6
0
        public void test()
        {
            Playlist      playlist      = TestUtil.parsePlaylistFromResource("mediaPlaylist.m3u8");
            MediaPlaylist mediaPlaylist = playlist.getMediaPlaylist();

            Assert.False(playlist.hasMasterPlaylist());
            Assert.True(playlist.hasMediaPlaylist());
            Assert.True(mediaPlaylist.hasStartData());
            Assert.Equal(-4.5, mediaPlaylist.getStartData().getTimeOffset(), 12);
            Assert.True(mediaPlaylist.getStartData().isPrecise());
            Assert.Equal(10, mediaPlaylist.getTargetDuration());
        }
Exemplo n.º 7
0
        private static void addMediaPlaylistErrors(MediaPlaylist playlist, HashSet <PlaylistError> errors, bool isExtended, ParsingMode parsingMode)
        {
            if (isExtended && playlist.hasStartData())
            {
                addStartErrors(playlist.getStartData(), errors);
            }

            addByteRangeErrors(playlist.getTracks(), errors, parsingMode);

            foreach (TrackData trackData in playlist.getTracks())
            {
                addTrackDataErrors(trackData, errors, isExtended, parsingMode);
            }
        }
Exemplo n.º 8
0
        public override bool Equals(object o)
        {
            if (!(o is MediaPlaylist))
            {
                return(false);
            }

            MediaPlaylist other = (MediaPlaylist)o;

            return(mTracks.SequenceEquals(other.mTracks) &&
                   mUnknownTags.SequenceEquals(other.mUnknownTags) &&
                   mTargetDuration == other.mTargetDuration &&
                   mMediaSequenceNumber == other.mMediaSequenceNumber &&
                   mIsIframesOnly == other.mIsIframesOnly &&
                   mIsOngoing == other.mIsOngoing &&
                   object.Equals(mPlaylistType, other.mPlaylistType) &&
                   object.Equals(mStartData, other.mStartData));
        }
Exemplo n.º 9
0
        public void playlistWithByteRanges()
        {
            Playlist         playlist      = TestUtil.parsePlaylistFromResource("mediaPlaylistWithByteRanges.m3u8");
            MediaPlaylist    mediaPlaylist = playlist.getMediaPlaylist();
            List <ByteRange> byteRanges    = new List <ByteRange>();

            foreach (TrackData track in mediaPlaylist.getTracks())
            {
                Assert.True(track.hasByteRange());
                byteRanges.Add(track.getByteRange());
            }

            List <ByteRange> expectedRanges = new List <ByteRange>()
            {
                new ByteRange(0, 10),
                new ByteRange(20),
                new ByteRange(30)
            };

            Assert.Equal(expectedRanges, byteRanges);

            var writtenPlaylist = writePlaylist(playlist);

            Assert.Equal(
                "#EXTM3U\n" +
                "#EXT-X-VERSION:4\n" +
                "#EXT-X-TARGETDURATION:10\n" +
                "#EXT-X-MEDIA-SEQUENCE:0\n" +
                "#EXT-X-BYTERANGE:0@10\n" +
                "#EXTINF:9.009\n" +
                "http://media.example.com/first.ts\n" +
                "#EXT-X-BYTERANGE:20\n" +
                "#EXTINF:9.009\n" +
                "http://media.example.com/first.ts\n" +
                "#EXT-X-BYTERANGE:30\n" +
                "#EXTINF:3.003\n" +
                "http://media.example.com/first.ts\n" +
                "#EXT-X-ENDLIST\n",
                writtenPlaylist);
        }
Exemplo n.º 10
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     writeAttributes(tagWriter, mMapInfo, HANDLERS);
 }
Exemplo n.º 11
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     writeAttributes(tagWriter, mEncryptionData, HANDLERS);
 }
Exemplo n.º 12
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     // deprecated
 }
Exemplo n.º 13
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     tagWriter.writeTag(getTag(), mediaPlaylist.getMediaSequenceNumber().ToString());
 }
Exemplo n.º 14
0
 public override void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     tagWriter.writeTag(getTag(), mediaPlaylist.getTargetDuration().ToString());
 }
Exemplo n.º 15
0
 public virtual void doWrite(TagWriter tagWriter, Playlist playlist, MediaPlaylist mediaPlaylist)
 {
     tagWriter.writeTag(getTag());
 }
Exemplo n.º 16
0
 public Builder withMediaPlaylist(MediaPlaylist mediaPlaylist)
 {
     mMediaPlaylist = mediaPlaylist;
     return(this);
 }