video: fixed disabling subtitles

This commit is contained in:
Thibault Deckers 2023-08-20 20:33:33 +02:00
parent 0fc2710e62
commit b34487f766

View file

@ -143,8 +143,9 @@ class _VideoStreamSelectionDialogState extends State<VideoStreamSelectionDialog>
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextDropdownButton<MediaStreamSummary>(
values: streams.whereNotNull().toList(),
// allow `null` subtitle stream to disable subtitles
child: TextDropdownButton<MediaStreamSummary?>(
values: streams,
valueText: _streamName,
value: current,
onChanged: streams.length > 1 ? (newValue) => setState(() => setter(newValue)) : null,