phase3: youtube_player_iframe 2.x->5.x migration (fromVideoId)
This commit is contained in:
@@ -97,14 +97,10 @@ class DesktopiGoShowLearnMoreState extends State<DesktopiGoShowLearnMore> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 0) {
|
} else if (((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 0) {
|
||||||
YoutubePlayerController _controller = YoutubePlayerController(
|
YoutubePlayerController _controller = YoutubePlayerController.fromVideoId(
|
||||||
initialVideoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
|
videoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
|
||||||
params: YoutubePlayerParams(
|
startSeconds: 0,
|
||||||
playlist: ((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 1 ?
|
params: const YoutubePlayerParams(
|
||||||
((widget.data['sections'] as List)[i]['youtube_videos'] as List).map((e) {
|
|
||||||
return '$e';
|
|
||||||
}).toList() : [], // Defining custom playlist
|
|
||||||
startAt: Duration(seconds: 0),
|
|
||||||
showControls: true,
|
showControls: true,
|
||||||
showFullscreenButton: false,
|
showFullscreenButton: false,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -79,14 +79,10 @@ class MobileiGoShowLearnMoreState extends State<MobileiGoShowLearnMore> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 0) {
|
} else if (((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 0) {
|
||||||
YoutubePlayerController _controller = YoutubePlayerController(
|
YoutubePlayerController _controller = YoutubePlayerController.fromVideoId(
|
||||||
initialVideoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
|
videoId: '${((widget.data['sections'] as List)[i]['youtube_videos'] as List)[0] as String}',
|
||||||
params: YoutubePlayerParams(
|
startSeconds: 0,
|
||||||
playlist: ((widget.data['sections'] as List)[i]['youtube_videos'] as List).length > 1 ?
|
params: const YoutubePlayerParams(
|
||||||
((widget.data['sections'] as List)[i]['youtube_videos'] as List).map((e) {
|
|
||||||
return '$e';
|
|
||||||
}).toList() : [], // Defining custom playlist
|
|
||||||
startAt: Duration(seconds: 0),
|
|
||||||
showControls: true,
|
showControls: true,
|
||||||
showFullscreenButton: false,
|
showFullscreenButton: false,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user