-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Rebuild VideoPlayer once VideoPlayerController finishes initialization. #767
Conversation
012e188
to
bcc75df
Compare
Otherwise if VideoPlayer is built shortly after the controller starts initialization and doesn't yet have _textureId filled the widgets renders as an empty Container and never rebuilds to show the video later.
bcc75df
to
2d23f5f
Compare
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.
LGTM!
This needs a version bump in pubspec/changelog.
...ages/video_player/android/src/main/java/io/flutter/plugins/videoplayer/QueuingEventSink.java
Outdated
Show resolved
Hide resolved
2d23f5f
to
b1a1c43
Compare
This ensure that initialization events that are generated in `onPlayerStateChanged` before the Dart side has chance to subscribe to the channel are queued and eventually delivered. Fixes flutter/flutter#21483.
b1a1c43
to
8c20b76
Compare
Updated the changelog and pubspec. |
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.
Still LGTM
Sigurd, are you able to merge this? |
Seems I still have access! |
I'll publish a new version as well |
Thank you! |
@nichtverstehen This breaks switching the Do you have any ideas why? Before I dig any deeper.. |
Oops, it's obvious in retrospect. We should react to |
…hanges. This fixes a bug introduced in flutter#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization.
…hanges. This fixes a bug introduced in flutter#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization.
Sent #769. |
…hanges. This fixes a bug introduced in flutter#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization.
…hanges. This fixes a bug introduced in flutter#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization.
* Update textureId in VideoPlayer widget when the attached controller changes. This fixes a bug introduced in #767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization. * Add tests for conditions identified in flutter/flutter#21483. This is a breaking change since it reduces the public interface of VideoPlayerController to make it easier to fake it in the test (and hide unnecessary implementation details).
…n. (flutter#767) * Rebuild VideoPlayer once VideoPlayerController finishes initialization. Otherwise if VideoPlayer is built shortly after the controller starts initialization and doesn't yet have _textureId filled the widgets renders as an empty Container and never rebuilds to show the video later. * Queue VideoPlayer events in the EventSink. This ensure that initialization events that are generated in `onPlayerStateChanged` before the Dart side has chance to subscribe to the channel are queued and eventually delivered. Fixes flutter/flutter#21483.
…er#769) * Update textureId in VideoPlayer widget when the attached controller changes. This fixes a bug introduced in flutter#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization. * Add tests for conditions identified in flutter/flutter#21483. This is a breaking change since it reduces the public interface of VideoPlayerController to make it easier to fake it in the test (and hide unnecessary implementation details).
…alization. (flutter#767)" This reverts commit 278e7ec.
* Update textureId in VideoPlayer widget when the attached controller changes. This fixes a bug introduced in flutter/plugins#767: if a State is attached to a new widget it never switched to the new controller. Also this change makes sure to remove listeners during deinitialization. * Add tests for conditions identified in flutter/flutter#21483. This is a breaking change since it reduces the public interface of VideoPlayerController to make it easier to fake it in the test (and hide unnecessary implementation details).
This eliminates the races in VideoPlayer plugin initialization.