blob: 996d7354cdcf0cbdd6bb218b84cbe28129873c0b [file] [log] [blame]
RUN(video.src = URL.createObjectURL(source))
EVENT(sourceopen)
Append the init segment in two chunks
RUN(sourceBuffer = source.addSourceBuffer(loader.type()))
Divide the init segment in two.
RUN(random = randomNumber(1, 271))
RUN(partial1 = loader.initSegment().slice(0, random))
RUN(partial2 = loader.initSegment().slice(random))
RUN(sourceBuffer.appendBuffer(partial1))
EVENT(update)
RUN(sourceBuffer.appendBuffer(partial2))
EVENT(loadedmetadata)
EVENT(update)
Append the two partial media segments in reverse order. Separated with an abort
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(1).slice(0, 65677)))
EVENT(update)
RUN(sourceBuffer.abort())
EXPECTED (sourceBuffer.buffered.length == '1') OK
EXPECTED (sourceBuffer.buffered.end(0) == '82.981') OK
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0).slice(0, 65677)))
EVENT(update)
EXPECTED (sourceBuffer.buffered.length == '2') OK
EXPECTED (sourceBuffer.buffered.end(0) == '6.041') OK
EXPECTED (sourceBuffer.buffered.end(1) == '82.981') OK
Clean sourcebuffer of all content.
RUN(sourceBuffer.remove(0, 100))
EVENT(update)
Clean sourcebuffer of all content.
Ensure an init segment is accepted right after an aborted partial media segment
RUN(sourceBuffer.abort())
RUN(sourceBuffer.remove(0, 100))
EVENT(update)
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(1).slice(0, 65677)))
EVENT(update)
RUN(sourceBuffer.abort())
EXPECTED (sourceBuffer.buffered.length == '1') OK
EXPECTED (sourceBuffer.buffered.end(0) == '82.981') OK
RUN(sourceBuffer.appendBuffer(loader.initSegment()))
EVENT(update)
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0).slice(0, 65677)))
EVENT(update)
EXPECTED (sourceBuffer.buffered.length == '2') OK
EXPECTED (sourceBuffer.buffered.end(0) == '6.041') OK
EXPECTED (sourceBuffer.buffered.end(1) == '82.981') OK
Clean sourcebuffer of all content.
RUN(sourceBuffer.abort())
RUN(sourceBuffer.remove(0, 100))
EVENT(update)
Same as above without waiting for the first append to complete. This is not a deterministic speced behaviour
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(1).slice(0, 65677)))
EVENT(updatestart)
RUN(sourceBuffer.abort())
RUN(sourceBuffer.appendBuffer(loader.initSegment()))
EVENT(update)
RUN(sourceBuffer.appendBuffer(loader.mediaSegment(0).slice(0, 65677)))
EVENT(update)
EXPECTED (sourceBuffer.buffered.length == '1') OK
EXPECTED (sourceBuffer.buffered.end(0) == '6.041') OK
END OF TEST