This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +32
-2
lines changed
packages/video_player/video_player Expand file tree Collapse file tree 6 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ ## 2.2.10
2+
3+ * iOS: Updates texture on ` seekTo ` .
4+
15## 2.2.9
26
37* Adds compatibility with ` video_player_platform_interface ` 5.0, which does not
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ target 'Runner' do
3131 flutter_install_all_ios_pods File . dirname ( File . realpath ( __FILE__ ) )
3232 target 'RunnerTests' do
3333 inherit! :search_paths
34+ pod 'OCMock' , '3.5'
3435 end
3536end
3637
Original file line number Diff line number Diff line change 55@import video_player;
66@import XCTest;
77
8+ #import < OCMock/OCMock.h>
9+
810@interface VideoPlayerTests : XCTestCase
911@end
1012
1113@implementation VideoPlayerTests
1214
1315- (void )testPlugin {
14- FLTVideoPlayerPlugin* plugin = [[FLTVideoPlayerPlugin alloc ] init ];
16+ FLTVideoPlayerPlugin * plugin = [[FLTVideoPlayerPlugin alloc ] init ];
1517 XCTAssertNotNil (plugin);
1618}
1719
20+ - (void )testSeekToInvokesTextureFrameAvailableOnTextureRegistry {
21+ NSObject <FlutterTextureRegistry> *mockTextureRegistry =
22+ OCMProtocolMock (@protocol (FlutterTextureRegistry));
23+ NSObject <FlutterPluginRegistry> *registry =
24+ (NSObject <FlutterPluginRegistry> *)[[UIApplication sharedApplication ] delegate ];
25+ NSObject <FlutterPluginRegistrar> *registrar =
26+ [registry registrarForPlugin: @" TEST_FLTVideoPlayerPlugin" ];
27+ NSObject <FlutterPluginRegistrar> *partialRegistrar = OCMPartialMock (registrar);
28+ OCMStub ([partialRegistrar textures ]).andReturn (mockTextureRegistry);
29+ [FLTVideoPlayerPlugin registerWithRegistrar: partialRegistrar];
30+ FLTVideoPlayerPlugin<FLTVideoPlayerApi> *videoPlayerPlugin =
31+ (FLTVideoPlayerPlugin<FLTVideoPlayerApi> *)[[FLTVideoPlayerPlugin alloc ]
32+ initWithRegistrar: partialRegistrar];
33+ FLTPositionMessage *message = [[FLTPositionMessage alloc ] init ];
34+ message.textureId = @101 ;
35+ message.position = @0 ;
36+ FlutterError *error;
37+ [videoPlayerPlugin seekTo: message error: &error];
38+ OCMVerify ([mockTextureRegistry textureFrameAvailable: message.textureId.intValue]);
39+ }
40+
1841@end
Original file line number Diff line number Diff line change 55#import < Flutter/Flutter.h>
66
77@interface FLTVideoPlayerPlugin : NSObject <FlutterPlugin>
8+ - (instancetype )initWithRegistrar : (NSObject <FlutterPluginRegistrar>*)registrar ;
89@end
Original file line number Diff line number Diff line change @@ -616,6 +616,7 @@ - (FLTPositionMessage*)position:(FLTTextureMessage*)input error:(FlutterError**)
616616- (void )seekTo : (FLTPositionMessage*)input error : (FlutterError**)error {
617617 FLTVideoPlayer* player = _players[input.textureId];
618618 [player seekTo: [input.position intValue ]];
619+ [_registry textureFrameAvailable: input.textureId.intValue];
619620}
620621
621622- (void )pause : (FLTTextureMessage*)input error : (FlutterError**)error {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ description: Flutter plugin for displaying inline video with other Flutter
33 widgets on Android, iOS, and web.
44repository : https://github.com/flutter/plugins/tree/master/packages/video_player/video_player
55issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22
6- version : 2.2.9
6+ version : 2.2.10
77
88environment :
99 sdk : " >=2.14.0 <3.0.0"
You can’t perform that action at this time.
0 commit comments