Play video with subtitles in JavaFX 2

2020-03-27 10:00发布

问题:

I notice that JavaFX 1 has a SubtitleTrack class for extracting subtitles from video files, but I can't find equivalent functionality in JavaFX 2 (a similarly named class in javafx.scene.media doesn't appear to exist. Is this functionality implemented at all in which case where has it moved to? Or is it planned for a future release?

回答1:

I don't think video subtitle support was implemented for JavaFX 2.2.

I think the Public API changes to media Tracks feature implements the functionality you ask about. You can test out the implementation in the latest jdk8 snapshot release.