-
Notifications
You must be signed in to change notification settings - Fork 107
[MBL-19554][Student][Teacher] Video playback conflict: previous MP4 keeps playing when a new one starts #3419
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
Fixed issue where multiple MP4 videos played simultaneously when playing a video from submission and then a video from comments. Solution: Added ExoAgent.pauseAllOtherAgents() method that pauses all other playing videos when BaseViewMediaActivity resumes, ensuring only one video plays at a time. Test plan: - Play submission video, then play comment video - verify only comment video plays - Play comment video, then play submission video - verify only submission video plays - Play comment video, then play another comment video - verify only new video plays 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
This PR adds functionality to pause all other playing videos when a media activity resumes, preventing multiple videos from playing simultaneously. The implementation is straightforward and addresses a real UX issue.
✅ Positives
- Clear intent: The feature prevents confusing multi-video playback scenarios
- Simple implementation: Uses existing ExoAgent infrastructure effectively
- Good code location: Companion object method is appropriately placed for static utility functionality
- Descriptive naming:
pauseAllOtherAgents()clearly communicates what it does
⚠️ Issues Found
- Thread safety:
agentInstancesHashMap may have concurrency issues when accessed from multiple activities/fragments simultaneously (libs/pandautils/src/main/java/com/instructure/pandautils/utils/ExoPlayerHelper.kt:256) - Logic refinement:
onResume()always pauses other videos, even when current video isn't playing - consider checking playback state first (libs/pandautils/src/main/java/com/instructure/pandautils/activities/BaseViewMediaActivity.kt:219) - Code style: Nested null checks can be simplified using Kotlin idioms (libs/pandautils/src/main/java/com/instructure/pandautils/utils/ExoPlayerHelper.kt:259-263)
📋 Testing Recommendations
Since there are no unit tests for this functionality, please verify these scenarios manually:
- Open video A, let it play, open video B → video A should pause
- Background the app while playing → verify behavior on resume
- Rotate screen during playback → ensure correct video continues
- Rapid navigation between multiple videos → no crashes or race conditions
- Multiple video instances in different fragments (if applicable)
🔒 Security & Performance
- No security concerns identified
- Performance impact is minimal (iterating over active video instances)
- No memory leaks apparent, but verify proper cleanup in production
Overall, this is a solid improvement to the media playback experience. The main concerns are around thread safety and edge case behavior during lifecycle events.
libs/pandautils/src/main/java/com/instructure/pandautils/utils/ExoPlayerHelper.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/utils/ExoPlayerHelper.kt
Show resolved
Hide resolved
libs/pandautils/src/main/java/com/instructure/pandautils/activities/BaseViewMediaActivity.kt
Show resolved
Hide resolved
📊 Code Coverage Report✅ Student
✅ Teacher
✅ Pandautils
📈 Overall Average
|
🧪 Unit Test Results✅ 📱 Student App
✅ 📱 Teacher App
✅ 🌅 Horizon
✅ 📦 Submodules
📊 Summary
Last updated: Fri, 28 Nov 2025 13:46:00 GMT |
adamNagy56
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA +1
Test plan
refs: MBL-19554
affects: Student, Teacher
release note: Fixed issue where multiple videos would play simultaneously in SpeedGrader
Checklist