This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 0.10.1+6
2+
3+ * [ iOS] Fixed a memory leak with notification observing.
4+
15## 0.10.1+5
26
37* Fix race condition while disposing the VideoController.
Original file line number Diff line number Diff line change @@ -82,20 +82,22 @@ - (void)addObservers:(AVPlayerItem*)item {
8282 options: NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew
8383 context: playbackBufferFullContext];
8484
85- [[NSNotificationCenter defaultCenter ] addObserverForName: AVPlayerItemDidPlayToEndTimeNotification
86- object: [_player currentItem ]
87- queue: [NSOperationQueue mainQueue ]
88- usingBlock: ^(NSNotification * note) {
89- if (self->_isLooping ) {
90- AVPlayerItem* p = [note object ];
91- [p seekToTime: kCMTimeZero
92- completionHandler: nil ];
93- } else {
94- if (self->_eventSink ) {
95- self->_eventSink (@{@" event" : @" completed" });
96- }
97- }
98- }];
85+ // Add an observer that will respond to itemDidPlayToEndTime
86+ [[NSNotificationCenter defaultCenter ] addObserver: self
87+ selector: @selector (itemDidPlayToEndTime: )
88+ name: AVPlayerItemDidPlayToEndTimeNotification
89+ object: item];
90+ }
91+
92+ - (void )itemDidPlayToEndTime : (NSNotification *)notification {
93+ if (_isLooping) {
94+ AVPlayerItem* p = [notification object ];
95+ [p seekToTime: kCMTimeZero completionHandler: nil ];
96+ } else {
97+ if (_eventSink) {
98+ _eventSink (@{@" event" : @" completed" });
99+ }
100+ }
99101}
100102
101103static inline CGFloat radiansToDegrees (CGFloat radians) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: video_player
22description : Flutter plugin for displaying inline video with other Flutter
33 widgets on Android and iOS.
44author : Flutter Team <flutter-dev@googlegroups.com>
5- version : 0.10.1+5
5+ version : 0.10.1+6
66homepage : https://github.com/flutter/plugins/tree/master/packages/video_player
77
88flutter :
You can’t perform that action at this time.
0 commit comments