Skip to content

Commit

Permalink
fix: full screen issue for youtube videos played in tutorials (#1321)
Browse files Browse the repository at this point in the history
* Fixed full screen issue for youtube videos played in tutorials
Added gitignore files for developers who use fvm

* fixed youtube full screen issue in multiple_choice_view

---------

Co-authored-by: priya7401 <[email protected]>
  • Loading branch information
priya7401 and priya7401 authored Jan 30, 2025
1 parent 172ce99 commit 4f619b2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mobile-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# FVM Version Cache
.fvm/
.fvmrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@ class MultipleChoiceView extends StatelessWidget {
),
);

controller.setFullScreenListener(
(_) async {
final videoData = await controller.videoData;
final startSeconds = await controller.currentTime;

final currentTime = await FullscreenYoutubePlayer.launch(
context,
videoId: videoData.videoId,
startSeconds: startSeconds,
);

if (currentTime != null) {
controller.seekTo(seconds: currentTime);
}
},
);

int numberOfDialogueHeaders = block.challenges
.where((challenge) => challenge.title.contains('Dialogue'))
.length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ class PythonView extends StatelessWidget {
),
);

controller.setFullScreenListener(
(_) async {
final videoData = await controller.videoData;
final startSeconds = await controller.currentTime;

final currentTime = await FullscreenYoutubePlayer.launch(
context,
videoId: videoData.videoId,
startSeconds: startSeconds,
);

if (currentTime != null) {
controller.seekTo(seconds: currentTime);
}
},
);

return PopScope(
canPop: true,
onPopInvokedWithResult: (bool didPop, dynamic result) {
Expand Down

0 comments on commit 4f619b2

Please sign in to comment.