From 0468215a07ffd1c6dde4cc686db5a6e4d9c47429 Mon Sep 17 00:00:00 2001 From: "omer.habib" Date: Mon, 21 Oct 2024 12:44:26 +0500 Subject: [PATCH] fix: Restrict screen display timed out while video is playing - Added flag to handle screen display timed out fix: LEARNER-10249 --- .../course/presentation/unit/video/VideoFullScreenFragment.kt | 1 + .../openedx/course/presentation/unit/video/VideoUnitFragment.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoFullScreenFragment.kt b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoFullScreenFragment.kt index 3caa4d7c6..8edaf76cc 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoFullScreenFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoFullScreenFragment.kt @@ -75,6 +75,7 @@ class VideoFullScreenFragment : Fragment(R.layout.fragment_video_full_screen) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + binding.playerView.keepScreenOn = true binding.root.setOnApplyWindowInsetsListener { _, insets -> val insetsCompat = WindowInsetsCompat.toWindowInsetsCompat(insets) .getInsets(WindowInsetsCompat.Type.systemBars()) diff --git a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitFragment.kt b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitFragment.kt index ce597c31f..f57b37d2a 100644 --- a/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitFragment.kt +++ b/course/src/main/java/org/openedx/course/presentation/unit/video/VideoUnitFragment.kt @@ -90,7 +90,7 @@ class VideoUnitFragment : Fragment(R.layout.fragment_video_unit) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - + binding.playerView.keepScreenOn = true binding.cvVideoTitle?.setContent { OpenEdXTheme { VideoTitle(text = requireArguments().getString(ARG_TITLE) ?: "")