var subList = subtitleTracks.asMap().entries.map((entry) {
int index = entry.key;
var track = entry.value;
var title = track.metadata['title'] ??
track.metadata['language'] ??
'Unknown';
return ListTile(
title: Text(title),
onTap: () {
player.activeSubtitleTracks = [index];
closeDialog();
},
);
}).toList();
for (var exSub in widget.item.subtitles) {
subList.add(ListTile(
title: Text(exSub.language),
onTap: () {
player.setMedia(
"${widget.item.originURL}${exSub.link}", MediaType.subtitle);
closeDialog();
},
));
}
This is building a list of subtitles, that are clickable. I can individually either set an internal OR external subtitles on a video. BUT if I set an external subtitle, I have to call player.setMedia, and after that, subsequent attempts at setting internal subtitle will fail.
I attempted to fix the issue by recalling setMedia() for internal subtitle like this (with the video stream URL):
It works, if I select an external and then an internal one, it will select it.
But when i do this, if I select an internal subtitle (which is going to call SetMedia with the video) THEN an external subtitle, the player just freezes, so I am assuming I'm not supposed to do that
I am currently setting subtitles this way:
This is building a list of subtitles, that are clickable. I can individually either set an internal OR external subtitles on a video. BUT if I set an external subtitle, I have to call player.setMedia, and after that, subsequent attempts at setting internal subtitle will fail. I attempted to fix the issue by recalling setMedia() for internal subtitle like this (with the video stream URL):
It works, if I select an external and then an internal one, it will select it. But when i do this, if I select an internal subtitle (which is going to call SetMedia with the video) THEN an external subtitle, the player just freezes, so I am assuming I'm not supposed to do that
Thanks for your help