Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Sequential WebVTT cues with the same contents can be dropped
https://bugs.webkit.org/show_bug.cgi?id=240893 Reviewed by Eric Carlson. When sequential WebVTT cues are parsed with the same contents, instead of dropping the new cue, extend its endTime of the existing cue to include the endTime of the newly parsed one. * LayoutTests/http/tests/media/hls/hls-webvtt-flashing-expected.txt: Added. * LayoutTests/http/tests/media/hls/hls-webvtt-flashing.html: Added. * LayoutTests/http/tests/media/resources/hls/subtitles/flashSequence0.webvtt: Added. * LayoutTests/http/tests/media/resources/hls/subtitles/prog_flashing.m3u8: Added. * LayoutTests/http/tests/media/resources/hls/test-webvtt-flashing.m3u8: Added. * LayoutTests/platform/glib/TestExpectations: * Source/WebCore/html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::newCuesParsed): * Source/WebCore/html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newCuesParsed): * Source/WebCore/html/track/TextTrack.cpp: (WebCore::TextTrack::matchCue): (WebCore::TextTrack::hasCue): Deleted. * Source/WebCore/html/track/TextTrack.h: (WebCore::TextTrack::hasCue): Canonical link: https://commits.webkit.org/250988@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294854 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
103 additions
and
18 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
@@ -0,0 +1,10 @@ | ||
|
||
EVENT(addtrack) | ||
EXPECTED (video.textTracks.length == '1') OK | ||
RUN(video.textTracks[0].mode = 'showing') | ||
EVENT(cuechange) | ||
EXPECTED (video.textTracks[0].activeCues.length == '1') OK | ||
EXPECTED (video.textTracks[0].activeCues[0].text == 'Subtitle Test') OK | ||
EXPECTED (video.textTracks[0].activeCues[0].endTime > '0.100') OK | ||
END OF TEST | ||
|
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
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src=../../media-resources/video-test.js></script> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function start() { | ||
video = document.getElementById('video'); | ||
video.src = "../resources/hls/test-webvtt-flashing.m3u8"; | ||
video.play(); | ||
waitForEventOnceOn(video.textTracks, 'addtrack', trackAdded); | ||
} | ||
|
||
function trackAdded() { | ||
testExpected("video.textTracks.length", "1"); | ||
run("video.textTracks[0].mode = 'showing'"); | ||
waitForEventOnceOn(video.textTracks[0], 'cuechange', cueChanged); | ||
} | ||
|
||
function cueChanged() { | ||
testExpected("video.textTracks[0].activeCues.length", "1"); | ||
testExpected("video.textTracks[0].activeCues[0].text", "Subtitle Test"); | ||
testExpected("video.textTracks[0].activeCues[0].endTime", "0.100", ">"); | ||
endTest(); | ||
} | ||
</script> | ||
</head> | ||
<body onload="start()"> | ||
<video id="video" muted loop></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
@@ -0,0 +1,8 @@ | ||
WEBVTT | ||
X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000 | ||
|
||
00:00:00.000 --> 00:00:00.100 | ||
Subtitle Test | ||
|
||
00:00:00.100 --> 00:00:01.000 | ||
Subtitle Test |
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
@@ -0,0 +1,8 @@ | ||
#EXTM3U | ||
#EXT-X-TARGETDURATION:30 | ||
#EXT-X-VERSION:3 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXT-X-PLAYLIST-TYPE:VOD | ||
#EXTINF:10, | ||
flashSequence0.webvtt | ||
#EXT-X-ENDLIST |
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
@@ -0,0 +1,6 @@ | ||
#EXTM3U | ||
|
||
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subtitles",LANGUAGE="en-US",NAME="English",AUTOSELECT=YES,DEFAULT=YES,URI="subtitles/prog_flashing.m3u8" | ||
|
||
#EXT-X-STREAM-INF:BANDWIDTH=634451,CODECS="mp4a.40.2, avc1.4d401e",RESOLUTION=640x480,SUBTITLES="subtitles" | ||
bipbop/prog_index.m3u8 |
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
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
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