mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add subtitle parsing support in HLS for TS files
PiperOrigin-RevId: 582714493
This commit is contained in:
parent
d5fbf0007b
commit
b750ad50f9
2 changed files with 10 additions and 8 deletions
|
|
@ -72,8 +72,6 @@
|
||||||
* Add experimental support for parsing subtitles during extraction. You
|
* Add experimental support for parsing subtitles during extraction. You
|
||||||
can enable this using
|
can enable this using
|
||||||
`HlsMediaSource.Factory.experimentalParseSubtitlesDuringExtraction()`.
|
`HlsMediaSource.Factory.experimentalParseSubtitlesDuringExtraction()`.
|
||||||
This works for standalone WebVTT subtitles and IMSC1 subtitles muxed
|
|
||||||
into MP4.
|
|
||||||
* DASH Extension:
|
* DASH Extension:
|
||||||
* Extend experimental support for parsing subtitles during extraction to
|
* Extend experimental support for parsing subtitles during extraction to
|
||||||
work with standalone text files (previously it only worked with
|
work with standalone text files (previously it only worked with
|
||||||
|
|
|
||||||
|
|
@ -207,12 +207,16 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
|
||||||
? new SubtitleTranscodingExtractor(mp4Extractor, subtitleParserFactory)
|
? new SubtitleTranscodingExtractor(mp4Extractor, subtitleParserFactory)
|
||||||
: mp4Extractor;
|
: mp4Extractor;
|
||||||
case FileTypes.TS:
|
case FileTypes.TS:
|
||||||
return createTsExtractor(
|
Extractor tsExtractor =
|
||||||
payloadReaderFactoryFlags,
|
createTsExtractor(
|
||||||
exposeCea608WhenMissingDeclarations,
|
payloadReaderFactoryFlags,
|
||||||
format,
|
exposeCea608WhenMissingDeclarations,
|
||||||
muxedCaptionFormats,
|
format,
|
||||||
timestampAdjuster);
|
muxedCaptionFormats,
|
||||||
|
timestampAdjuster);
|
||||||
|
return subtitleParserFactory != null
|
||||||
|
? new SubtitleTranscodingExtractor(tsExtractor, subtitleParserFactory)
|
||||||
|
: tsExtractor;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue