setSubtitleTrack method
Sets the current SubtitleTrack for subtitle output.
- Currently selected SubtitleTrack can be accessed using
state.track.subtitle
orstream.track.subtitle
. - The list of currently available SubtitleTracks can be obtained accessed using
state.tracks.subtitle
orstream.tracks.subtitle
. - External subtitle track can be loaded using SubtitleTrack.uri or SubtitleTrack.data constructor.
player.setSubtitleTrack(
SubtitleTrack.uri(
'https://www.iandevlin.com/html5test/webvtt/upc-video-subtitles-en.vtt',
title: 'English',
language: 'en',
),
);
Implementation
Future<void> setSubtitleTrack(SubtitleTrack track) async {
return platform?.setSubtitleTrack(track);
}