Skip to content
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

Fixed Video Player Crash and late initialization errors in flutter test #654

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

badnikhil
Copy link
Contributor

@badnikhil badnikhil commented Mar 10, 2025

…Flutter tests.

PR Description

This PR addresses an issue where the Video Previewer widget was crashing during UI updates, such as tab switching, window resizing, or other state changes.

the Video Previewer widget was getting disposed when switching tabs, resizing the window, or performing similar UI updates. However, when the widget received an update after being removed from the widget tree, it caused an application crash.

For example

Switching to "Headers" and then back to "Response Body" led to a crash.

When resizing the window, video reinitialization was expected, but it didn’t happen, leading to unexpected behavior.

I identified the issue and successfully fixed it by preventing unnecessary disposals, ensuring smooth transitions without crashes.

Related Issues

Fix Implemented:

  • Prevented video controller disposal crashes by pausing instead of disposing when the widget tree updates.
  • Fixed the LateInitializationError related to _videoController by handling initialization.

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with the project main branch before making this PR
  • I am using the latest Flutter stable branch (flutter upgrade verified)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

  • Yes
  • No, and this is why: Not needed for this fix

OS on which you have developed and tested the feature?

  • Windows
  • Android / iOS
  • macOS
  • Linux

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.

Fix video player crash
1 participant