Skip to content

Pause media playback when swiping to the next submission #3393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vargaat
Copy link
Collaborator

@vargaat vargaat commented May 22, 2025

What's new?

  • The bug was about AV players not being paused on swiping to the next student but I also added pause for webviews as well. The new thing here is the didTransitionTo method in SpeedGraderViewModel.
  • Moved pages view controller protocol conformances to extensions for better separation of concerns within SpeedGraderViewModel.
  • Added a findAllChildViewControllers method to get all child view controllers of a type and also fixed the existing UIView counterpart method to properly detect when a view of the searched type is a subview of another searched type.
  • Added two debug methods to print view and viewcontroller hierarchy. This comes handy when the view hierarchy debugger doesn't show the view tree properly.

refs: MBL-18859
affects: Teacher
release note: none

test plan: See ticket for test submissions.

Checklist

  • Tested on phone
  • Tested on tablet

refs: MBL-18859
affects: Teacher
release note: none

test plan: See ticket for test submissions.
@vargaat vargaat self-assigned this May 22, 2025
@inst-danger
Copy link
Contributor

inst-danger commented May 22, 2025

Teacher Build QR Code:

@inst-danger
Copy link
Contributor

inst-danger commented May 22, 2025

Warnings
⚠️ This pull request will not generate a release note.

Affected Apps: Teacher

MBL-18859

Coverage New % Master % Delta
Canvas iOS 91.59% 91.61% -0.02%

Generated by 🚫 dangerJS against 712e4f8

rh12
rh12 previously approved these changes May 26, 2025
Copy link
Contributor

@rh12 rh12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA + 1

Minor clarification: the media actually stops, not just pauses (which is strange, since the https://developer.apple.com/documentation/avfoundation/avplayer/pause() method should just pause.)
But I think it's good enough or maybe even preferred.

One somewhat related finding: rotating to landscape on iPad (@ iOS 17) the video stops, but this is not a regression.

Copy link
Contributor

@suhaibabsi-inst suhaibabsi-inst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code +1

Copy link
Contributor

@suhaibabsi-inst suhaibabsi-inst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA +1

Tested on iPhone XS, iOS 18.3.1

@vargaat vargaat dismissed stale reviews from suhaibabsi-inst and rh12 via 31b71e9 May 28, 2025 08:56
@vargaat vargaat requested review from suhaibabsi-inst and rh12 May 28, 2025 08:56
@rh12 rh12 merged commit 98c2c9e into master May 28, 2025
4 checks passed
@rh12 rh12 deleted the bugfix/MBL-18859-Pause-media-playback-when-switching-assignments-in-SpeedGrader branch May 28, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants