flutter_cast_framework_modern/ios/Classes/PlatformBridgeApis.h
2023-03-28 13:18:35 +02:00

361 lines
17 KiB
Objective-C

// Autogenerated from Pigeon (v9.0.7), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger;
@protocol FlutterMessageCodec;
@class FlutterError;
@class FlutterStandardTypedData;
NS_ASSUME_NONNULL_BEGIN
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaInfo
typedef NS_ENUM(NSUInteger, StreamType) {
/// An invalid (unknown) stream type.
StreamTypeInvalid = 0,
/// A stream type of "none".
StreamTypeNone = 1,
/// A buffered stream type.
StreamTypeBuffered = 2,
/// A live stream type.
StreamTypeLive = 3,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
typedef NS_ENUM(NSUInteger, MediaType) {
/// A media type representing generic media content.
MediaTypeGeneric = 0,
/// A media type representing a movie.
MediaTypeMovie = 1,
/// A media type representing an TV show.
MediaTypeTvShow = 2,
/// A media type representing a music track.
MediaTypeMusicTrack = 3,
/// A media type representing a photo.
MediaTypePhoto = 4,
/// A media type representing an audiobook chapter.
MediaTypeAudiobookChapter = 5,
/// The smallest media type value that can be assigned for application-defined media types.
MediaTypeUser = 6,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
typedef NS_ENUM(NSUInteger, MediaMetadataKey) {
/// String key: Album artist.
MediaMetadataKeyAlbumArtist = 0,
/// String key: Album title.
MediaMetadataKeyAlbumTitle = 1,
/// String key: Artist.
MediaMetadataKeyArtist = 2,
/// String key: Audiobook title.
MediaMetadataKeyBookTitle = 3,
/// String key: Broadcast date.
MediaMetadataKeyBroadcastDate = 4,
/// String key: Chapter number.
MediaMetadataKeyChapterNumber = 5,
/// String key: Chapter title.
MediaMetadataKeyChapterTitle = 6,
/// String key: Composer.
MediaMetadataKeyComposer = 7,
/// String key: Creation date.
MediaMetadataKeyCreationDate = 8,
/// Integer key: Disc number.
MediaMetadataKeyDiscNumber = 9,
/// Integer key: Episode number.
MediaMetadataKeyEpisodeNumber = 10,
/// Integer key: Height.
MediaMetadataKeyHeight = 11,
/// Double key: Location latitude.
MediaMetadataKeyLocationLatitude = 12,
/// Double key: Location longitude.
MediaMetadataKeyLocationLongitude = 13,
/// String key: Location name.
MediaMetadataKeyLocationName = 14,
/// Int key: Queue item ID.
MediaMetadataKeyQueueItemId = 15,
/// String key: Release date.
MediaMetadataKeyReleaseDate = 16,
/// Integer key: Season number.
MediaMetadataKeySeasonNumber = 17,
/// Time key in milliseconds: section duration.
MediaMetadataKeySectionDuration = 18,
/// Time key in milliseconds: section start absolute time.
MediaMetadataKeySectionStartAbsoluteTime = 19,
/// Time key in milliseconds: section start time in the container.
MediaMetadataKeySectionStartTimeInContainer = 20,
/// Time key in milliseconds: section start time in media item.
MediaMetadataKeySectionStartTimeInMedia = 21,
/// String key: Series title.
MediaMetadataKeySeriesTitle = 22,
/// String key: Studio.
MediaMetadataKeyStudio = 23,
/// String key: Subtitle.
MediaMetadataKeySubtitle = 24,
/// String key: Title.
MediaMetadataKeyTitle = 25,
/// Integer key: Track number.
MediaMetadataKeyTrackNumber = 26,
/// Integer key: Width.
MediaMetadataKeyWidth = 27,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
typedef NS_ENUM(NSUInteger, TrackType) {
/// A media track type indicating an unknown track type.
TrackTypeUnknown = 0,
/// A media track type indicating a text track.
TrackTypeText = 1,
/// A media track type indicating an audio track.
TrackTypeAudio = 2,
/// A media track type indicating a video track.
TrackTypeVideo = 3,
};
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
typedef NS_ENUM(NSUInteger, TrackSubtype) {
/// A media track subtype indicating an unknown subtype.
TrackSubtypeUnknown = 0,
/// A media track subtype indicating no subtype.
TrackSubtypeNone = 1,
/// A media track subtype indicating subtitles.
TrackSubtypeSubtitles = 2,
/// A media track subtype indicating closed captions.
TrackSubtypeCaptions = 3,
/// A media track subtype indicating descriptions.
TrackSubtypeDescriptions = 4,
/// A media track subtype indicating chapters.
TrackSubtypeChapters = 5,
/// A media track subtype indicating metadata.
TrackSubtypeMetadata = 6,
};
/// State of the remote media player
typedef NS_ENUM(NSUInteger, PlayerState) {
/// Constant indicating unknown player state.
PlayerStateUnknown = 0,
/// Constant indicating that the media player is idle.
PlayerStateIdle = 1,
/// Constant indicating that the media player is playing.
PlayerStatePlaying = 2,
/// Constant indicating that the media player is paused.
PlayerStatePaused = 3,
/// Constant indicating that the media player is buffering.
PlayerStateBuffering = 4,
/// Constant indicating that the media player is loading.
PlayerStateLoading = 5,
};
@class MediaLoadRequestData;
@class MediaInfo;
@class MediaMetadata;
@class WebImage;
@class MediaTrack;
@class MediaStatus;
@class AdBreakStatus;
@class AdBreakClipInfo;
@class MediaQueueItem;
@class CastDevice;
@class CastMessage;
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaLoadRequestData
@interface MediaLoadRequestData : NSObject
+ (instancetype)makeWithShouldAutoplay:(nullable NSNumber *)shouldAutoplay
currentTime:(nullable NSNumber *)currentTime
mediaInfo:(nullable MediaInfo *)mediaInfo;
@property(nonatomic, strong, nullable) NSNumber * shouldAutoplay;
@property(nonatomic, strong, nullable) NSNumber * currentTime;
@property(nonatomic, strong, nullable) MediaInfo * mediaInfo;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaInfo
@interface MediaInfo : NSObject
+ (instancetype)makeWithContentId:(nullable NSString *)contentId
streamType:(StreamType)streamType
contentType:(nullable NSString *)contentType
mediaMetadata:(nullable MediaMetadata *)mediaMetadata
mediaTracks:(nullable NSArray<MediaTrack *> *)mediaTracks
streamDuration:(nullable NSNumber *)streamDuration
adBreakClips:(nullable NSArray<AdBreakClipInfo *> *)adBreakClips
customDataAsJson:(nullable NSString *)customDataAsJson;
@property(nonatomic, copy, nullable) NSString * contentId;
@property(nonatomic, assign) StreamType streamType;
@property(nonatomic, copy, nullable) NSString * contentType;
@property(nonatomic, strong, nullable) MediaMetadata * mediaMetadata;
@property(nonatomic, strong, nullable) NSArray<MediaTrack *> * mediaTracks;
@property(nonatomic, strong, nullable) NSNumber * streamDuration;
@property(nonatomic, strong, nullable) NSArray<AdBreakClipInfo *> * adBreakClips;
/// String containing a json object
@property(nonatomic, copy, nullable) NSString * customDataAsJson;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaMetadata
@interface MediaMetadata : NSObject
+ (instancetype)makeWithMediaType:(MediaType)mediaType
strings:(nullable NSDictionary<NSString *, NSString *> *)strings
webImages:(nullable NSArray<WebImage *> *)webImages;
@property(nonatomic, assign) MediaType mediaType;
@property(nonatomic, strong, nullable) NSDictionary<NSString *, NSString *> * strings;
@property(nonatomic, strong, nullable) NSArray<WebImage *> * webImages;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/common/images/WebImage
@interface WebImage : NSObject
+ (instancetype)makeWithUrl:(nullable NSString *)url;
@property(nonatomic, copy, nullable) NSString * url;
@end
/// Docs here: https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack
@interface MediaTrack : NSObject
+ (instancetype)makeWithId:(nullable NSNumber *)id
trackType:(TrackType)trackType
name:(nullable NSString *)name
trackSubtype:(TrackSubtype)trackSubtype
contentId:(nullable NSString *)contentId
language:(nullable NSString *)language;
@property(nonatomic, strong, nullable) NSNumber * id;
@property(nonatomic, assign) TrackType trackType;
@property(nonatomic, copy, nullable) NSString * name;
@property(nonatomic, assign) TrackSubtype trackSubtype;
@property(nonatomic, copy, nullable) NSString * contentId;
@property(nonatomic, copy, nullable) NSString * language;
@end
@interface MediaStatus : NSObject
+ (instancetype)makeWithPlayerState:(PlayerState)playerState
isPlayingAd:(nullable NSNumber *)isPlayingAd
mediaInfo:(nullable MediaInfo *)mediaInfo
adBreakStatus:(nullable AdBreakStatus *)adBreakStatus;
@property(nonatomic, assign) PlayerState playerState;
@property(nonatomic, strong, nullable) NSNumber * isPlayingAd;
@property(nonatomic, strong, nullable) MediaInfo * mediaInfo;
@property(nonatomic, strong, nullable) AdBreakStatus * adBreakStatus;
@end
@interface AdBreakStatus : NSObject
+ (instancetype)makeWithAdBreakId:(nullable NSString *)adBreakId
adBreakClipId:(nullable NSString *)adBreakClipId
whenSkippableMs:(nullable NSNumber *)whenSkippableMs;
@property(nonatomic, copy, nullable) NSString * adBreakId;
@property(nonatomic, copy, nullable) NSString * adBreakClipId;
@property(nonatomic, strong, nullable) NSNumber * whenSkippableMs;
@end
@interface AdBreakClipInfo : NSObject
+ (instancetype)makeWithId:(nullable NSString *)id
title:(nullable NSString *)title
contentId:(nullable NSString *)contentId
contentUrl:(nullable NSString *)contentUrl
clickThroughUrl:(nullable NSString *)clickThroughUrl
durationMs:(nullable NSNumber *)durationMs
imageUrl:(nullable NSString *)imageUrl
mimeType:(nullable NSString *)mimeType
whenSkippableMs:(nullable NSNumber *)whenSkippableMs;
@property(nonatomic, copy, nullable) NSString * id;
@property(nonatomic, copy, nullable) NSString * title;
@property(nonatomic, copy, nullable) NSString * contentId;
@property(nonatomic, copy, nullable) NSString * contentUrl;
@property(nonatomic, copy, nullable) NSString * clickThroughUrl;
@property(nonatomic, strong, nullable) NSNumber * durationMs;
@property(nonatomic, copy, nullable) NSString * imageUrl;
@property(nonatomic, copy, nullable) NSString * mimeType;
@property(nonatomic, strong, nullable) NSNumber * whenSkippableMs;
@end
@interface MediaQueueItem : NSObject
+ (instancetype)makeWithItemId:(nullable NSNumber *)itemId
playbackDuration:(nullable NSNumber *)playbackDuration
startTime:(nullable NSNumber *)startTime
media:(nullable MediaInfo *)media
autoplay:(nullable NSNumber *)autoplay
preloadTime:(nullable NSNumber *)preloadTime;
@property(nonatomic, strong, nullable) NSNumber * itemId;
@property(nonatomic, strong, nullable) NSNumber * playbackDuration;
@property(nonatomic, strong, nullable) NSNumber * startTime;
@property(nonatomic, strong, nullable) MediaInfo * media;
@property(nonatomic, strong, nullable) NSNumber * autoplay;
@property(nonatomic, strong, nullable) NSNumber * preloadTime;
@end
@interface CastDevice : NSObject
+ (instancetype)makeWithDeviceId:(nullable NSString *)deviceId
friendlyName:(nullable NSString *)friendlyName
modelName:(nullable NSString *)modelName;
@property(nonatomic, copy, nullable) NSString * deviceId;
@property(nonatomic, copy, nullable) NSString * friendlyName;
@property(nonatomic, copy, nullable) NSString * modelName;
@end
@interface CastMessage : NSObject
+ (instancetype)makeWithNamespace:(nullable NSString *)namespace
message:(nullable NSString *)message;
@property(nonatomic, copy, nullable) NSString * namespace;
@property(nonatomic, copy, nullable) NSString * message;
@end
/// The codec used by CastHostApi.
NSObject<FlutterMessageCodec> *CastHostApiGetCodec(void);
/// APIs for Flutter-to-Host comunication
@protocol CastHostApi
- (void)sendMessageMessage:(CastMessage *)message error:(FlutterError *_Nullable *_Nonnull)error;
- (void)showCastDialogWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)setMuteMuted:(NSNumber *)muted error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable CastDevice *)getCastDeviceWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)loadMediaLoadRequestDataRequest:(MediaLoadRequestData *)request error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable MediaInfo *)getMediaInfoWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)playWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)pauseWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)stopWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)showTracksChooserDialogWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)skipAdWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)queueAppendItemItem:(MediaQueueItem *)item error:(FlutterError *_Nullable *_Nonnull)error;
- (void)queueNextItemWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)queuePrevItemWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)getQueueItemCountWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable MediaQueueItem *)getQueueItemAtIndexIndex:(NSNumber *)index error:(FlutterError *_Nullable *_Nonnull)error;
@end
extern void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastHostApi> *_Nullable api);
/// The codec used by CastFlutterApi.
NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec(void);
/// APIs for Host-to-Flutter comunication
@interface CastFlutterApi : NSObject
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;
- (void)getSessionMessageNamespacesWithCompletion:(void (^)(NSArray<NSString *> *_Nullable, FlutterError *_Nullable))completion;
- (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMessageReceivedMessage:(CastMessage *)message completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionStartFailedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionEndingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionEndedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumingWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionResumeFailedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSessionSuspendedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMetadataUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onQueueStatusUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onPreloadStatusUpdatedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onSendingRemoteMediaRequestWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onAdBreakStatusUpdatedMediaStatus:(MediaStatus *)mediaStatus completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onMediaErrorWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)onProgressUpdatedProgressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs completion:(void (^)(FlutterError *_Nullable))completion;
- (void)onAdBreakClipProgressUpdatedAdBreakId:(NSString *)adBreakId adBreakClipId:(NSString *)adBreakClipId progressMs:(NSNumber *)progressMs durationMs:(NSNumber *)durationMs whenSkippableMs:(NSNumber *)whenSkippableMs completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsInsertedInRangeInsertIndex:(NSNumber *)insertIndex insertCount:(NSNumber *)insertCount completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsReloadedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsRemovedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsReorderedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes insertBeforeIndex:(NSNumber *)insertBeforeIndex completion:(void (^)(FlutterError *_Nullable))completion;
- (void)itemsUpdatedAtIndexesIndexes:(NSArray<NSNumber *> *)indexes completion:(void (^)(FlutterError *_Nullable))completion;
- (void)mediaQueueChangedWithCompletion:(void (^)(FlutterError *_Nullable))completion;
- (void)mediaQueueWillChangeWithCompletion:(void (^)(FlutterError *_Nullable))completion;
@end
NS_ASSUME_NONNULL_END