mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
fix(HLS): Fix subtitle timing (#7625)
Simplifies subtitle management for sequence mode and segments mode Runs subtitle tests in segments mode as well (Tizen 3.0) Fixes: https://github.com/shaka-project/shaka-player/issues/7447
This commit is contained in:
committed by
GitHub
parent
67cbe9915d
commit
9e2b15ead4
@@ -86,13 +86,7 @@ shaka.text.VttTextParser = class {
|
||||
// Only use 'X-TIMESTAMP-MAP' with HLS. This overrides offset above.
|
||||
if (blocks[0].includes('X-TIMESTAMP-MAP') &&
|
||||
this.manifestType_ == shaka.media.ManifestParser.HLS) {
|
||||
if (this.sequenceMode_) {
|
||||
// Compute a different, rollover-based offset for sequence mode.
|
||||
offset = this.computeHlsSequenceModeOffset_(blocks[0], time);
|
||||
} else {
|
||||
// Calculate the offset from the segment startTime.
|
||||
offset = time.segmentStart;
|
||||
}
|
||||
offset = this.computeHlsOffset_(blocks[0], time);
|
||||
}
|
||||
|
||||
// Parse VTT regions.
|
||||
@@ -129,7 +123,7 @@ shaka.text.VttTextParser = class {
|
||||
* @return {number}
|
||||
* @private
|
||||
*/
|
||||
computeHlsSequenceModeOffset_(headerBlock, time) {
|
||||
computeHlsOffset_(headerBlock, time) {
|
||||
// https://bit.ly/2K92l7y
|
||||
// The 'X-TIMESTAMP-MAP' header is used in HLS to align text with
|
||||
// the rest of the media.
|
||||
|
||||
Reference in New Issue
Block a user