From 36f36b815f664bbbed2358d5d3dfe602445a03cd Mon Sep 17 00:00:00 2001 From: peima Date: Sun, 26 Jul 2026 01:11:47 +0800 Subject: [PATCH] phase3: youtube_player_iframe 2.x->5.x migration (fromVideoId) --- lib/widgets/desktop/desktop_igoshow_learn_more.dart | 12 ++++-------- lib/widgets/mobile/mobile_igoshow_learn_more.dart | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/widgets/desktop/desktop_igoshow_learn_more.dart b/lib/widgets/desktop/desktop_igoshow_learn_more.dart index c5c1f3f..f3e351a 100644 --- a/lib/widgets/desktop/desktop_igoshow_learn_more.dart +++ b/lib/widgets/desktop/desktop_igoshow_learn_more.dart @@ -97,14 +97,10 @@ class DesktopiGoShowLearnMoreState extends State { ), ); } 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, ), diff --git a/lib/widgets/mobile/mobile_igoshow_learn_more.dart b/lib/widgets/mobile/mobile_igoshow_learn_more.dart index 520201f..b0c591c 100644 --- a/lib/widgets/mobile/mobile_igoshow_learn_more.dart +++ b/lib/widgets/mobile/mobile_igoshow_learn_more.dart @@ -79,14 +79,10 @@ class MobileiGoShowLearnMoreState extends State { ), ); } 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, ),