-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MSE] Periodically monitor source buffers.
https://bugs.webkit.org/show_bug.cgi?id=125898 Reviewed by Eric Carlson. Source/WebCore: Test: media/media-source/media-source-monitor-source-buffers.html The MSE spec requires that the SourceBuffer Monitoring step is run periodically during playback. No specific update interval is specified so we will re-use the existing HTMLMediaElement playback progress timer to signal the media source monitoring. * html/HTMLMediaElement.cpp: (HTMLMediaElement::playbackProgressTimerFired): LayoutTests: * media/media-source/media-source-monitor-source-buffers-expected.txt: Added. * media/media-source/media-source-monitor-source-buffers.html: Added. Canonical link: https://commits.webkit.org/143907@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
LayoutTests/media/media-source/media-source-monitor-source-buffers-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
EXPECTED (source.readyState == 'closed') OK | ||
EVENT(sourceopen) | ||
RUN(sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")) | ||
RUN(sourceBuffer.appendBuffer(initSegment)) | ||
EVENT(updateend) | ||
RUN(sourceBuffer.appendBuffer(sample)) | ||
EVENT(updateend) | ||
RUN(video.play()) | ||
EVENT(waiting) TEST(video.readyState == HTMLMediaElement.HAVE_CURRENT_DATA) OK | ||
END OF TEST | ||
|
53 changes: 53 additions & 0 deletions
53
LayoutTests/media/media-source/media-source-monitor-source-buffers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>mock-media-source</title> | ||
<script src="mock-media-source.js"></script> | ||
<script src="../video-test.js"></script> | ||
<script> | ||
var source; | ||
var sourceBuffer; | ||
var initSegment; | ||
var sample; | ||
|
||
if (window.internals) | ||
internals.initializeMockMediaSource(); | ||
|
||
function runTest() | ||
{ | ||
findMediaElement(); | ||
|
||
source = new MediaSource(); | ||
testExpected('source.readyState', 'closed'); | ||
|
||
waitForEventOn(source, 'sourceopen', sourceOpen); | ||
video.src = URL.createObjectURL(source); | ||
} | ||
|
||
function sourceOpen() | ||
{ | ||
run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")'); | ||
waitForEventOn(sourceBuffer, 'updateend', loadSamples, false, true); | ||
initSegment = makeAInit(100, [makeATrack(1, 'mock', TRACK_KIND.VIDEO)]); | ||
run('sourceBuffer.appendBuffer(initSegment)'); | ||
} | ||
|
||
function loadSamples() | ||
{ | ||
sample = makeASample(0, 0, 10, 1, SAMPLE_FLAG.SYNC); | ||
waitForEventOn(sourceBuffer, 'updateend', play, false, true); | ||
run('sourceBuffer.appendBuffer(sample)'); | ||
} | ||
|
||
function play() | ||
{ | ||
waitForEventTestAndEnd('waiting', 'video.readyState == HTMLMediaElement.HAVE_CURRENT_DATA'); | ||
run('video.play()'); | ||
} | ||
|
||
</script> | ||
</head> | ||
<body onload="runTest()"> | ||
<video></video> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters