Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions packages/video_player/video_player_avfoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.10.0

* Implements `setPreventsDisplaySleepDuringVideoPlayback` using
`AVPlayer.preventsDisplaySleepDuringVideoPlayback`.

## 2.9.4

* Ensures that the display link does not continue requesting frames after a player is disposed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,12 @@ - (void)selectAudioTrackAtIndex:(NSInteger)trackIndex
}
}

- (void)setPreventsDisplaySleepDuringVideoPlayback:(BOOL)preventsDisplaySleepDuringVideoPlayback error:(FlutterError *_Nullable *_Nonnull)error {
if (@available(iOS 12.0, macOS 10.14, *)) {
self.player.preventsDisplaySleepDuringVideoPlayback = preventsDisplaySleepDuringVideoPlayback;
}
}

#pragma mark - Private

- (int64_t)duration {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v26.1.7), do not edit directly.
// Autogenerated from Pigeon (v26.2.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon

@import Foundation;
Expand All @@ -22,41 +22,42 @@ NS_ASSUME_NONNULL_BEGIN
@interface FVPPlatformVideoViewCreationParams : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithPlayerId:(NSInteger)playerId;
@property(nonatomic, assign) NSInteger playerId;
+ (instancetype)makeWithPlayerId:(NSInteger )playerId;
@property(nonatomic, assign) NSInteger playerId;
@end

@interface FVPCreationOptions : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithUri:(NSString *)uri
httpHeaders:(NSDictionary<NSString *, NSString *> *)httpHeaders;
@property(nonatomic, copy) NSString *uri;
@property(nonatomic, copy) NSDictionary<NSString *, NSString *> *httpHeaders;
httpHeaders:(NSDictionary<NSString *, NSString *> *)httpHeaders;
@property(nonatomic, copy) NSString * uri;
@property(nonatomic, copy) NSDictionary<NSString *, NSString *> * httpHeaders;
@end

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

/// Raw audio track data from AVMediaSelectionOption (for HLS streams).
@interface FVPMediaSelectionAudioTrackData : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithIndex:(NSInteger)index
displayName:(nullable NSString *)displayName
languageCode:(nullable NSString *)languageCode
isSelected:(BOOL)isSelected
commonMetadataTitle:(nullable NSString *)commonMetadataTitle;
@property(nonatomic, assign) NSInteger index;
@property(nonatomic, copy, nullable) NSString *displayName;
@property(nonatomic, copy, nullable) NSString *languageCode;
@property(nonatomic, assign) BOOL isSelected;
@property(nonatomic, copy, nullable) NSString *commonMetadataTitle;
+ (instancetype)makeWithIndex:(NSInteger )index
displayName:(nullable NSString *)displayName
languageCode:(nullable NSString *)languageCode
isSelected:(BOOL )isSelected
commonMetadataTitle:(nullable NSString *)commonMetadataTitle;
@property(nonatomic, assign) NSInteger index;
@property(nonatomic, copy, nullable) NSString * displayName;
@property(nonatomic, copy, nullable) NSString * languageCode;
@property(nonatomic, assign) BOOL isSelected;
@property(nonatomic, copy, nullable) NSString * commonMetadataTitle;
@end

/// The codec used by all APIs.
Expand All @@ -65,25 +66,17 @@ NSObject<FlutterMessageCodec> *FVPGetMessagesCodec(void);
@protocol FVPAVFoundationVideoPlayerApi
- (void)initialize:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)createPlatformViewPlayerWithOptions:(FVPCreationOptions *)params
error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable NSNumber *)createPlatformViewPlayerWithOptions:(FVPCreationOptions *)params error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable FVPTexturePlayerIds *)
createTexturePlayerWithOptions:(FVPCreationOptions *)creationOptions
error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable FVPTexturePlayerIds *)createTexturePlayerWithOptions:(FVPCreationOptions *)creationOptions error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setMixWithOthers:(BOOL)mixWithOthers error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable NSString *)fileURLForAssetWithName:(NSString *)asset
package:(nullable NSString *)package
error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable NSString *)fileURLForAssetWithName:(NSString *)asset package:(nullable NSString *)package 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);

@protocol FVPVideoPlayerInstanceApi
- (void)setLooping:(BOOL)looping error:(FlutterError *_Nullable *_Nonnull)error;
Expand All @@ -96,17 +89,13 @@ extern void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(
- (void)pauseWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)disposeWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSArray<FVPMediaSelectionAudioTrackData *> *)getAudioTracks:
(FlutterError *_Nullable *_Nonnull)error;
- (void)selectAudioTrackAtIndex:(NSInteger)trackIndex
error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable NSArray<FVPMediaSelectionAudioTrackData *> *)getAudioTracks:(FlutterError *_Nullable *_Nonnull)error;
- (void)selectAudioTrackAtIndex:(NSInteger)trackIndex error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPreventsDisplaySleepDuringVideoPlayback:(BOOL)preventsDisplaySleepDuringVideoPlayback error:(FlutterError *_Nullable *_Nonnull)error;
@end

extern void SetUpFVPVideoPlayerInstanceApi(id<FlutterBinaryMessenger> binaryMessenger,
NSObject<FVPVideoPlayerInstanceApi> *_Nullable api);
extern void SetUpFVPVideoPlayerInstanceApi(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FVPVideoPlayerInstanceApi> *_Nullable api);

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

NS_ASSUME_NONNULL_END
Loading