Files
SellyCloudSDK_demo/Example/SellyCloudSDK/Network/AVApiService.h
2026-04-07 18:20:16 +08:00

40 lines
1.1 KiB
Objective-C

//
// AVApiService.h
// SellyCloudSDK_Example
//
#import <Foundation/Foundation.h>
@class AVLiveStreamModel;
NS_ASSUME_NONNULL_BEGIN
typedef void(^AVApiSuccess)(id _Nullable responseObject);
typedef void(^AVApiFailure)(NSError *error);
@interface AVApiService : NSObject
+ (instancetype)shared;
/// GET /live/sdk/alive-list
- (void)fetchLiveStreams:(void(^)(NSArray<AVLiveStreamModel *> *streams))success
failure:(nullable AVApiFailure)failure;
/// POST /live/sdk/demo/stream-xor
- (void)reportXorKeyWithVhost:(NSString *)vhost
app:(NSString *)app
stream:(NSString *)stream
xorKey:(nullable NSString *)xorKey
success:(nullable AVApiSuccess)success
failure:(nullable AVApiFailure)failure;
/// POST /live/sdk/demo/login
- (void)loginWithUsername:(NSString *)username
password:(NSString *)password
success:(void(^)(id responseObject))success
failure:(void(^)(NSError *error, NSString * _Nullable serverMessage))failure;
@end
NS_ASSUME_NONNULL_END