Fix buffering behaviour and eventSink bug on iOS
This commit is contained in:
parent
eee50d712e
commit
fb0cd4af7d
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# NOTE: This podspec is NOT to be published. It is only used as a local source!
|
||||
#
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Flutter'
|
||||
s.version = '1.0.0'
|
||||
s.summary = 'High-performance, high-fidelity mobile apps.'
|
||||
s.description = <<-DESC
|
||||
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
|
||||
DESC
|
||||
s.homepage = 'https://flutter.io'
|
||||
s.license = { :type => 'MIT' }
|
||||
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
|
||||
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.vendored_frameworks = 'Flutter.framework'
|
||||
end
|
|
@ -114,6 +114,7 @@
|
|||
}
|
||||
|
||||
- (void)broadcastPlaybackEvent {
|
||||
if (!_eventSink) return;
|
||||
long long now = (long long)([[NSDate date] timeIntervalSince1970] * 1000.0);
|
||||
_updatePosition = [self getCurrentPosition];
|
||||
_updateTime = now;
|
||||
|
@ -150,6 +151,11 @@
|
|||
[self broadcastPlaybackEvent];
|
||||
}
|
||||
|
||||
- (void)setPlaybackBufferingState:(enum PlaybackState)state buffering:(BOOL)buffering {
|
||||
_buffering = buffering;
|
||||
[self setPlaybackState:state];
|
||||
}
|
||||
|
||||
- (void)setUrl:(NSString*)url result:(FlutterResult)result {
|
||||
// TODO: error if already connecting
|
||||
_connectionResult = result;
|
||||
|
@ -271,7 +277,7 @@
|
|||
[_player pause];
|
||||
[_player seekToTime:CMTimeMake(0, 1000)
|
||||
completionHandler:^(BOOL finished) {
|
||||
[self setPlaybackState:stopped];
|
||||
[self setPlaybackBufferingState:stopped buffering:NO];
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -279,7 +285,7 @@
|
|||
[_player pause];
|
||||
[_player seekToTime:CMTimeMake(0, 1000)
|
||||
completionHandler:^(BOOL finished) {
|
||||
[self setPlaybackState:completed];
|
||||
[self setPlaybackBufferingState:completed buffering:NO];
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue