phase3: youtube_player_iframe 2.x->5.x migration (fromVideoId)

This commit is contained in:
2026-07-26 01:11:47 +08:00
parent 6d789c7b19
commit 36f36b815f
2 changed files with 8 additions and 16 deletions

View File

@@ -79,14 +79,10 @@ class MobileiGoShowLearnMoreState extends State<MobileiGoShowLearnMore> {
),
);
} else if (((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 0) {
YoutubePlayerController _controller = YoutubePlayerController(
initialVideoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
params: YoutubePlayerParams(
playlist: ((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 1 ?
((widget.data['sections'] as List)[i]['youtube_videos'] as List).map((e) {
return '$e';
}).toList() : [], // Defining custom playlist
startAt: Duration(seconds: 0),
YoutubePlayerController _controller = YoutubePlayerController.fromVideoId(
videoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
startSeconds: 0,
params: const YoutubePlayerParams(
showControls: true,
showFullscreenButton: false,
),