Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
595d3df
#60048: Migration from flutter-plugins to flutter-packages
vanlooverenkoen Mar 20, 2023
4831f57
Updated doc
vanlooverenkoen Mar 20, 2023
976b630
Merged current main into ios pip
vanlooverenkoen Mar 20, 2023
a7d5dd5
#60048: Formatting
vanlooverenkoen Mar 20, 2023
876dfe8
Fixed formatting
vanlooverenkoen Mar 20, 2023
a4ca9e7
#60048: Updated the changelogs
vanlooverenkoen Mar 21, 2023
49f769a
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 3, 2023
5477f0b
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 15, 2023
0764e27
#60048: Updated comments related to docs & typo's
vanlooverenkoen Apr 15, 2023
65fdf65
Renamed setAutomaticallyStartPictureInPicture to setAutomaticallyStar…
vanlooverenkoen Apr 16, 2023
d4d9ff9
Updated starting to started to match stopped enum values
vanlooverenkoen Apr 17, 2023
ff6d02f
Removed some logic to pause
vanlooverenkoen Apr 17, 2023
ae7500a
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 10, 2023
4eeb6e1
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 11, 2023
9110d0f
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 22, 2023
211c6b3
Fixed the formatting & pigeon run
vanlooverenkoen Jun 22, 2023
5a8735b
Fixed documentation
vanlooverenkoen Jun 22, 2023
4583229
Updated the dto's to setup the picture in picture
vanlooverenkoen Jun 22, 2023
70284aa
Fixed documentation
vanlooverenkoen Jun 23, 2023
7289998
Fixed 2 bugs where the permissions were not correct and an issue with…
vanlooverenkoen Jun 23, 2023
ee96f77
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 23, 2023
da13c09
Fixed formatting & tests
vanlooverenkoen Jun 23, 2023
4d83a52
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jun 24, 2023
ac920fe
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jul 25, 2023
8394840
Fixed the version bumper for the the video_player itself
vanlooverenkoen Jul 25, 2023
19b1440
Fixed comments
vanlooverenkoen Jul 25, 2023
1963d27
Fixed some comments
vanlooverenkoen Jul 31, 2023
f71a27a
Fixed formaating
vanlooverenkoen Jul 31, 2023
b3e05a0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Jul 31, 2023
1325254
Fixed documentation
vanlooverenkoen Jul 31, 2023
72ba79a
Fixed comment on UIBackgroundModes
vanlooverenkoen Aug 1, 2023
8c67ab8
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Aug 1, 2023
f935a16
Fixed a bug where the top & left overlay settings were incorrect
vanlooverenkoen Aug 1, 2023
42a7815
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Nov 25, 2023
fa93319
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Nov 25, 2023
b0103d0
updated documentation
vanlooverenkoen Nov 25, 2023
236ab51
fix ios tests
vanlooverenkoen Nov 25, 2023
1cf961d
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Dec 14, 2023
5c18256
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 7, 2024
ddc7139
camera override video_player plugin
vanlooverenkoen Mar 7, 2024
45494b9
fix camera dependency overrides
vanlooverenkoen Mar 7, 2024
0597f32
fix macos implementation (only do validation on capabilities on iOS &…
vanlooverenkoen Mar 7, 2024
5c1f759
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 8, 2024
e94ccaa
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Mar 11, 2024
9dc85a0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 23, 2024
2b72605
fix formatting
vanlooverenkoen Apr 23, 2024
601c506
fix formatting & unwanted changes
vanlooverenkoen Apr 23, 2024
4574fa9
fix: remove the video_player dependency overrides
vanlooverenkoen Apr 23, 2024
1135695
fix: add the dependency override of video_player_avfoundation
vanlooverenkoen Apr 23, 2024
cd7fede
fix: add all the correct dependency overrides
vanlooverenkoen Apr 23, 2024
e9aba08
changelog version to specific version
vanlooverenkoen Apr 23, 2024
30c0b7a
Update pubspec.yaml
vanlooverenkoen Apr 23, 2024
c0ccbfc
Update pubspec.yaml
vanlooverenkoen Apr 23, 2024
8ee1dcb
fix: formatting of video_player
vanlooverenkoen Apr 23, 2024
58db59a
fix: compatability
vanlooverenkoen Apr 23, 2024
16ae8cb
fix: integervalue
vanlooverenkoen Apr 23, 2024
a15c3b7
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 23, 2024
87b92c2
fix: test on macOS
vanlooverenkoen Apr 23, 2024
5183028
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 24, 2024
002faa0
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
148cd55
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
d88cf33
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 25, 2024
45f96f5
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen Apr 26, 2024
9459bd5
Merge branch 'main' into feature/#60048-ios-picture-in-picture
vanlooverenkoen May 8, 2024
d9f883b
fix formatting
vanlooverenkoen May 8, 2024
c9993dc
fix: macos checks
vanlooverenkoen May 8, 2024
3e401c1
fix: comment
vanlooverenkoen May 8, 2024
b250e9c
fix: check on macOS where there are no capabilities required to use p…
vanlooverenkoen May 8, 2024
01aaf8d
Revert "fix: add all the correct dependency overrides"
Nols1000 Jan 2, 2025
ee6db47
Revert "camera override video_player plugin"
Nols1000 Jan 2, 2025
2e3196b
Update the documentation on configuring the required ios capabilities
Nols1000 Jan 2, 2025
29c1d3b
Merge remote-tracking branch 'origin/main' into feature/#60048-ios-pi…
Nols1000 Jan 2, 2025
6d8fb1e
[video_player_android] regenerate pigeons
Nols1000 Jan 2, 2025
114f5b8
[video_player_avfoundation] regenerate pigeons
Nols1000 Jan 2, 2025
5861e1d
Revert changes to the camera_android_camerax example
Nols1000 Jan 2, 2025
114f9ac
[video_player] fix todo making the picture-in-picture message const
Nols1000 Jan 2, 2025
3c1b4e6
[video_player] add tests to ensure equals implementation for isPictur…
Nols1000 Jan 2, 2025
3985a77
[video_player_avfoundation] refactor picture in picture extension
Nols1000 Jan 3, 2025
1649be4
[video_player_avfoundation] refactor code
Nols1000 Jan 3, 2025
bc56139
[video_player] format code
Nols1000 Jan 3, 2025
e1348c8
[video_player_avfoundation] reorder imports
Nols1000 Jan 3, 2025
7e70da0
[video_player] update version
Nols1000 Jan 3, 2025
4abe6f1
[video_player_android] Revert all changes made to this package
Nols1000 Jan 3, 2025
2006494
[video_player] upgrade dependencies
Nols1000 Jan 3, 2025
58dabf4
[video_player] fix dependencies for example
Nols1000 Jan 3, 2025
881e80e
[video_player_android] add overwrite to fix analysis error
Nols1000 Jan 3, 2025
917bdd4
[video_player_avfoundation] fix type issue with isPictureInPictureSup…
Nols1000 Jan 4, 2025
fba55da
[video_player_avfoundation] refactore naming and setting the start of…
Nols1000 Jan 5, 2025
b0f42d8
[video_player] Update dependencies
Nols1000 Jan 8, 2025
e0231d8
Merge remote-tracking branch 'origin/main' into feature/#60048-ios-pi…
Nols1000 Jan 8, 2025
c58b722
[video_player] Upgrade dart version
Nols1000 Jan 8, 2025
376bcf5
[video_player] Update dependencies
Nols1000 Jan 8, 2025
5dd6e13
[camera] Add video_player_platform_interface to overwrite
Nols1000 Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: formatting of video_player
  • Loading branch information
vanlooverenkoen committed Apr 23, 2024
commit 8ee1dcbf253a131204dc77a2643daf796aa39544
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ - (instancetype)initWithPlayerItem:(AVPlayerItem *)item
// Setting it to 1 would result in the picture-in-picture overlay always showing over other
// widget. Setting it to 0.001 makes the placeholder invisible, but still allows the
// picture-in-picture.
_playerLayer.opacity = 0.001;
_playerLayer.opacity = 0.001;
[self.flutterViewLayer addSublayer:_playerLayer];

[self setupPiPController];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the style guide; see https://google.github.io/styleguide/objcguide.html#avoid-messaging-the-current-object-within-initializers-and--dealloc (some existing code also does this, but that code is also incorrect, and we shouldn't add more of it).

You can instead make a static C function with the logic, which accepts self and sets values using self->_foo = bar instead of calling setters.

Expand Down Expand Up @@ -356,12 +356,12 @@ - (void)setupPiPController {
- (void)setAutomaticallyStartsPictureInPicture:
(BOOL)canStartPictureInPictureAutomaticallyFromInline {
if (!self.pictureInPictureController) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check doesn't appear to be necessary.

#if TARGET_OS_IOS
if (@available(iOS 14.2, *)) {
self.pictureInPictureController.canStartPictureInPictureAutomaticallyFromInline =
canStartPictureInPictureAutomaticallyFromInline;
}
#endif
#if TARGET_OS_IOS
if (@available(iOS 14.2, *)) {
self.pictureInPictureController.canStartPictureInPictureAutomaticallyFromInline =
canStartPictureInPictureAutomaticallyFromInline;
}
#endif
}

- (void)setPictureInPictureOverlaySettings:(CGRect)frame {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The argument is a frame, not a settings object, so the signature needs to reflect that in its naming.

Expand Down Expand Up @@ -920,16 +920,16 @@ - (void)setAutomaticallyStartsPictureInPicture:
(FVPAutomaticallyStartsPictureInPictureMessage *)input
error:(FlutterError **)error {
FVPVideoPlayer *player = self.playersByTextureId[@(input.textureId)];
[player setAutomaticallyStartsPictureInPicture:input.enableStartPictureInPictureAutomaticallyFromInline];
[player setAutomaticallyStartsPictureInPicture:
input.enableStartPictureInPictureAutomaticallyFromInline];
}

- (void)setPictureInPictureOverlaySettings:(FVPSetPictureInPictureOverlaySettingsMessage *)input
error:(FlutterError **)error {
FVPVideoPlayer *player = self.playersByTextureId[@(input.textureId)];
[player setPictureInPictureOverlaySettings:CGRectMake(input.settings.left,
input.settings.top,
input.settings.width,
input.settings.height)];
[player
setPictureInPictureOverlaySettings:CGRectMake(input.settings.left, input.settings.top,
input.settings.width, input.settings.height)];
}

- (BOOL)doesInfoPlistSupportPictureInPicture {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

infoPlistDeclaresBackgroundModeSupport

Expand All @@ -939,17 +939,17 @@ - (BOOL)doesInfoPlistSupportPictureInPicture {
}

- (void)startPictureInPicture:(FVPStartPictureInPictureMessage *)input
error:(FlutterError **)error {
#if TARGET_OS_IOS
if (![self doesInfoPlistSupportPictureInPicture]) {
*error = [FlutterError
errorWithCode:@"video_player"
message:@"Failed to start picture-in-picture because UIBackgroundModes: audio "
@"is not enabled in Info.plist"
details:nil];
return;
}
#endif
error:(FlutterError **)error {
#if TARGET_OS_IOS
if (![self doesInfoPlistSupportPictureInPicture]) {
*error = [FlutterError
errorWithCode:@"video_player"
message:@"Failed to start picture-in-picture because UIBackgroundModes: audio "
@"is not enabled in Info.plist"
details:nil];
return;
}
#endif

FVPVideoPlayer *player = self.playersByTextureId[@(input.textureId)];
[player startOrStopPictureInPicture:YES];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,58 @@ NS_ASSUME_NONNULL_BEGIN
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithAsset:(nullable NSString *)asset
uri:(nullable NSString *)uri
packageName:(nullable NSString *)packageName
formatHint:(nullable NSString *)formatHint
httpHeaders:(NSDictionary<NSString *, NSString *> *)httpHeaders;
@property(nonatomic, copy, nullable) NSString * asset;
@property(nonatomic, copy, nullable) NSString * uri;
@property(nonatomic, copy, nullable) NSString * packageName;
@property(nonatomic, copy, nullable) NSString * formatHint;
@property(nonatomic, copy) NSDictionary<NSString *, NSString *> * httpHeaders;
uri:(nullable NSString *)uri
packageName:(nullable NSString *)packageName
formatHint:(nullable NSString *)formatHint
httpHeaders:(NSDictionary<NSString *, NSString *> *)httpHeaders;
@property(nonatomic, copy, nullable) NSString *asset;
@property(nonatomic, copy, nullable) NSString *uri;
@property(nonatomic, copy, nullable) NSString *packageName;
@property(nonatomic, copy, nullable) NSString *formatHint;
@property(nonatomic, copy) NSDictionary<NSString *, NSString *> *httpHeaders;
@end

@interface FVPAutomaticallyStartsPictureInPictureMessage : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTextureId:(NSInteger )textureId
enableStartPictureInPictureAutomaticallyFromInline:(BOOL )enableStartPictureInPictureAutomaticallyFromInline;
@property(nonatomic, assign) NSInteger textureId;
@property(nonatomic, assign) BOOL enableStartPictureInPictureAutomaticallyFromInline;
+ (instancetype)makeWithTextureId:(NSInteger)textureId
enableStartPictureInPictureAutomaticallyFromInline:
(BOOL)enableStartPictureInPictureAutomaticallyFromInline;
@property(nonatomic, assign) NSInteger textureId;
@property(nonatomic, assign) BOOL enableStartPictureInPictureAutomaticallyFromInline;
@end

@interface FVPSetPictureInPictureOverlaySettingsMessage : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTextureId:(NSInteger )textureId
settings:(nullable FVPPictureInPictureOverlaySettingsMessage *)settings;
@property(nonatomic, assign) NSInteger textureId;
@property(nonatomic, strong, nullable) FVPPictureInPictureOverlaySettingsMessage * settings;
+ (instancetype)makeWithTextureId:(NSInteger)textureId
settings:(nullable FVPPictureInPictureOverlaySettingsMessage *)settings;
@property(nonatomic, assign) NSInteger textureId;
@property(nonatomic, strong, nullable) FVPPictureInPictureOverlaySettingsMessage *settings;
@end

@interface FVPPictureInPictureOverlaySettingsMessage : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTop:(double )top
left:(double )left
width:(double )width
height:(double )height;
@property(nonatomic, assign) double top;
@property(nonatomic, assign) double left;
@property(nonatomic, assign) double width;
@property(nonatomic, assign) double height;
+ (instancetype)makeWithTop:(double)top left:(double)left width:(double)width height:(double)height;
@property(nonatomic, assign) double top;
@property(nonatomic, assign) double left;
@property(nonatomic, assign) double width;
@property(nonatomic, assign) double height;
@end

@interface FVPStartPictureInPictureMessage : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTextureId:(NSInteger )textureId;
@property(nonatomic, assign) NSInteger textureId;
+ (instancetype)makeWithTextureId:(NSInteger)textureId;
@property(nonatomic, assign) NSInteger textureId;
@end

@interface FVPStopPictureInPictureMessage : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTextureId:(NSInteger )textureId;
@property(nonatomic, assign) NSInteger textureId;
+ (instancetype)makeWithTextureId:(NSInteger)textureId;
@property(nonatomic, assign) NSInteger textureId;
@end

/// The codec used by FVPAVFoundationVideoPlayerApi.
Expand All @@ -86,27 +84,45 @@ NSObject<FlutterMessageCodec> *FVPAVFoundationVideoPlayerApiGetCodec(void);
@protocol FVPAVFoundationVideoPlayerApi
- (void)initialize:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)createWithOptions:(FVPCreationOptions *)creationOptions error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable NSNumber *)createWithOptions:(FVPCreationOptions *)creationOptions
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)disposePlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setLooping:(BOOL)isLooping forPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setVolume:(double)volume forPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPlaybackSpeed:(double)speed forPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setLooping:(BOOL)isLooping
forPlayer:(NSInteger)textureId
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setVolume:(double)volume
forPlayer:(NSInteger)textureId
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPlaybackSpeed:(double)speed
forPlayer:(NSInteger)textureId
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)playPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)positionForPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)seekTo:(NSInteger)position forPlayer:(NSInteger)textureId completion:(void (^)(FlutterError *_Nullable))completion;
- (nullable NSNumber *)positionForPlayer:(NSInteger)textureId
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)seekTo:(NSInteger)position
forPlayer:(NSInteger)textureId
completion:(void (^)(FlutterError *_Nullable))completion;
- (void)pausePlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setMixWithOthers:(BOOL)mixWithOthers error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)isPictureInPictureSupported:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPictureInPictureOverlaySettings:(FVPSetPictureInPictureOverlaySettingsMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setAutomaticallyStartsPictureInPicture:(FVPAutomaticallyStartsPictureInPictureMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
- (void)startPictureInPicture:(FVPStartPictureInPictureMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
- (void)stopPictureInPicture:(FVPStopPictureInPictureMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPictureInPictureOverlaySettings:(FVPSetPictureInPictureOverlaySettingsMessage *)msg
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setAutomaticallyStartsPictureInPicture:(FVPAutomaticallyStartsPictureInPictureMessage *)msg
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)startPictureInPicture:(FVPStartPictureInPictureMessage *)msg
error:(FlutterError *_Nullable *_Nonnull)error;
- (void)stopPictureInPicture:(FVPStopPictureInPictureMessage *)msg
error:(FlutterError *_Nullable *_Nonnull)error;
@end

extern void SetUpFVPAVFoundationVideoPlayerApi(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FVPAVFoundationVideoPlayerApi> *_Nullable api);
extern void SetUpFVPAVFoundationVideoPlayerApi(
id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FVPAVFoundationVideoPlayerApi> *_Nullable api);

extern void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FVPAVFoundationVideoPlayerApi> *_Nullable api, NSString *messageChannelSuffix);
extern void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(
id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FVPAVFoundationVideoPlayerApi> *_Nullable api, NSString *messageChannelSuffix);

NS_ASSUME_NONNULL_END
Loading