优化节点ip缓存逻辑

This commit is contained in:
caleb
2026-04-14 18:12:36 +08:00
parent 5bf4b293f2
commit f78ca66860
85 changed files with 150367 additions and 20 deletions

View File

@@ -254,7 +254,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
3CC727B02EE6A947000027B2 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
3CC727B02EE6A947000027B2 /* Exceptions for "ScreenShareUploader" folder in "ScreenShareUploader" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Info.plist,
@@ -264,7 +264,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
3CC727A52EE6A947000027B2 /* ScreenShareUploader */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (3CC727B02EE6A947000027B2 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = ScreenShareUploader; sourceTree = "<group>"; };
3CC727A52EE6A947000027B2 /* ScreenShareUploader */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
3CC727B02EE6A947000027B2 /* Exceptions for "ScreenShareUploader" folder in "ScreenShareUploader" target */,
);
explicitFileTypes = {
};
explicitFolders = (
);
path = ScreenShareUploader;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>SellyCloudSDK.framework/SellyCloudSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SellyCloudSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SellyCloudSDK.framework/SellyCloudSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>SellyCloudSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,40 @@
//
// LFLiveDebug.h
// LaiFeng
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface LFLiveDebug : NSObject
@property (nonatomic, copy) NSString *streamId; ///< 流id
@property (nonatomic, copy) NSString *uploadUrl; ///< 流地址
@property (nonatomic, assign) CGSize videoSize; ///< 上传的分辨率
@property (nonatomic, assign) BOOL isRtmp; ///< 上传方式TCP or RTMP
@property (nonatomic, assign) CGFloat elapsedMilli; ///< 距离上次统计的时间 单位ms
@property (nonatomic, assign) CGFloat timeStamp; ///< 当前的时间戳从而计算1s内数据
@property (nonatomic, assign) CGFloat dataFlow; ///< 总流量
@property (nonatomic, assign) CGFloat bandwidth; ///< 1s内总带宽
@property (nonatomic, assign) CGFloat currentBandwidth; ///< 上次的带宽
@property (nonatomic, assign) CGFloat audioBandwidth;
@property (nonatomic, assign) CGFloat videoBandwidth;
@property (nonatomic, assign) CGFloat currentAudioBandwidth;
@property (nonatomic, assign) CGFloat currentVideoBandwidth;
@property (nonatomic, assign) NSInteger dropFrame; ///< 丢掉的帧数
@property (nonatomic, assign) NSInteger totalFrame; ///< 总帧数
@property (nonatomic, assign) NSInteger capturedAudioCount; ///< 1s内音频捕获个数
@property (nonatomic, assign) NSInteger capturedVideoCount; ///< 1s内视频捕获个数
@property (nonatomic, assign) NSInteger currentCapturedAudioCount; ///< 上次的音频捕获个数
@property (nonatomic, assign) NSInteger currentCapturedVideoCount; ///< 上次的视频捕获个数
@property (nonatomic, assign) NSInteger unSendCount; ///< 未发送个数(代表当前缓冲区等待发送的)
@end

View File

@@ -0,0 +1,47 @@
//
// SellyCloudManager.h
// SellyCloudSDK
//
// Created by Caleb on 7/7/25.
//
#import <Foundation/Foundation.h>
#import "SellyLiveVideoConfiguration.h"
#import "SellyLiveAudioConfiguration.h"
#import "SellyLivePusherDelegate.h"
#import "SellyLivePlayerDelegate.h"
#import "LFLiveDebug.h"
#import "SellyPublicDefinition.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyLiveVideoPusher.h"
#import "SellyLivePusherStats.h"
#import "SellyRTCSession.h"
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCSessionDelegate.h"
#import "SellyRTCReplayKitHandler.h"
#import "SellyCloudSDKError.h"
#import "SellyVodVideoPlayer.h"
#import "SellyVodPlayerDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyCloudManager : NSObject
+ (instancetype)sharedInstance;
//用户id
@property (nonatomic, strong)NSString *userId;
- (void)startWithVHost:(NSString *)vhost appName:(NSString *)appName;
/**
设置代理服务器地址(如洋葱盾转化后的地址)
@param address 代理地址,格式如 http://127.0.0.1:12345
*/
+ (void)setProxyAddress:(NSString *)address;
+ (NSString *)sdkVersion;
+ (void)uploadLog:(void(^)(NSString * _Nullable url, NSError * _Nullable error))callback;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,501 @@
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
#ifndef SELLYCLOUDSDK_SWIFT_H
#define SELLYCLOUDSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#if defined(__OBJC__)
#include <Foundation/Foundation.h>
#endif // defined(__OBJC__)
#if defined(__cplusplus)
#include <cstdint>
#include <cstddef>
#include <cstdbool>
#include <cstring>
#include <stdlib.h>
#include <new>
#include <type_traits>
#else
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#endif
#if defined(__cplusplus)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
# include <ptrauth.h>
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
# ifndef __ptrauth_swift_value_witness_function_pointer
# define __ptrauth_swift_value_witness_function_pointer(x)
# endif
# ifndef __ptrauth_swift_class_method_pointer
# define __ptrauth_swift_class_method_pointer(x)
# endif
#pragma clang diagnostic pop
#endif
#pragma clang diagnostic pop
#endif
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef unsigned char char8_t;
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if !defined(SWIFT_RUNTIME_NAME)
# if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
# else
# define SWIFT_RUNTIME_NAME(X)
# endif
#endif
#if !defined(SWIFT_COMPILE_NAME)
# if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
# else
# define SWIFT_COMPILE_NAME(X)
# endif
#endif
#if !defined(SWIFT_METHOD_FAMILY)
# if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
# else
# define SWIFT_METHOD_FAMILY(X)
# endif
#endif
#if !defined(SWIFT_NOESCAPE)
# if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
# else
# define SWIFT_NOESCAPE
# endif
#endif
#if !defined(SWIFT_RELEASES_ARGUMENT)
# if __has_attribute(ns_consumed)
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
# else
# define SWIFT_RELEASES_ARGUMENT
# endif
#endif
#if !defined(SWIFT_WARN_UNUSED_RESULT)
# if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
# else
# define SWIFT_WARN_UNUSED_RESULT
# endif
#endif
#if !defined(SWIFT_NORETURN)
# if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
# else
# define SWIFT_NORETURN
# endif
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
# else
# define SWIFT_ENUM(_type, _name, _extensibility) _type _name; enum
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM_TAG)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_TAG enum
# else
# define SWIFT_ENUM_TAG
# endif
#endif
#if !defined(SWIFT_ENUM_FWD_DECL)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_FWD_DECL(_type, _name) enum _name : _type;
# else
# define SWIFT_ENUM_FWD_DECL(_type, _name) typedef _type _name;
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_AVAILABILITY_DOMAIN)
# define SWIFT_AVAILABILITY_DOMAIN(dom, ...) __attribute__((availability(domain: dom, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED_OBJC)
# if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
# else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
# endif
#endif
#if defined(__OBJC__)
#if !defined(IBSegueAction)
# define IBSegueAction
#endif
#endif
#if !defined(SWIFT_EXTERN)
# if defined(__cplusplus)
# define SWIFT_EXTERN extern "C"
# else
# define SWIFT_EXTERN extern
# endif
#endif
#if !defined(SWIFT_CALL)
# define SWIFT_CALL __attribute__((swiftcall))
#endif
#if !defined(SWIFT_INDIRECT_RESULT)
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
#endif
#if !defined(SWIFT_CONTEXT)
# define SWIFT_CONTEXT __attribute__((swift_context))
#endif
#if !defined(SWIFT_ERROR_RESULT)
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
#endif
#if defined(__cplusplus)
# define SWIFT_NOEXCEPT noexcept
#else
# define SWIFT_NOEXCEPT
#endif
#if !defined(SWIFT_C_INLINE_THUNK)
# if __has_attribute(always_inline)
# if __has_attribute(nodebug)
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
# else
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
# endif
# else
# define SWIFT_C_INLINE_THUNK inline
# endif
#endif
#if defined(_WIN32)
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
#endif
#else
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL
#endif
#endif
#if !__has_feature(nullability)
# define _Nonnull
# define _Nullable
# define _Null_unspecified
#elif !defined(__OBJC__)
# pragma clang diagnostic ignored "-Wnullability-extension"
#endif
#if !__has_feature(nullability_nullable_result)
# define _Nullable_result _Nullable
#endif
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
} // extern "C"
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__OBJC__)
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import AVFoundation;
@import CoreFoundation;
@import Foundation;
@import MetalKit;
@import ObjectiveC;
@import UIKit;
#endif
#endif // defined(__OBJC__)
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__OBJC__)
@class UIView;
@protocol HKRtmpPusherProtocol;
@class SellyLiveVideoConfiguration;
@class SellyLiveAudioConfiguration;
@class NSString;
SWIFT_CLASS("_TtC13SellyCloudSDK12HKRtmpPusher")
@interface HKRtmpPusher : NSObject
@property (nonatomic, strong) UIView * _Nullable preview;
@property (nonatomic) NSInteger reconnectInterval;
@property (nonatomic) NSInteger reconnectCount;
@property (nonatomic, strong) id <HKRtmpPusherProtocol> _Nullable delegate;
@property (nonatomic) enum AVCaptureDevicePosition currentPosition;
@property (nonatomic) BOOL muted;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (void)startRunning:(enum AVCaptureDevicePosition)captureDevicePosition videoConfig:(SellyLiveVideoConfiguration * _Nonnull)videoConfig audioConfig:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startRunningAudio:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startLive:(NSString * _Nonnull)urlStr;
- (void)stopLive;
- (void)startCamera;
- (void)stopCamera;
- (void)switchCamera;
- (void)setPreviewView:(UIView * _Nonnull)view;
@end
@class SellyLivePusherStats;
SWIFT_PROTOCOL("_TtP13SellyCloudSDK20HKRtmpPusherProtocol_")
@protocol HKRtmpPusherProtocol
///
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onPushStatusChanged:(NSString * _Nonnull)status;
@optional
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onLiveStatsChanged:(SellyLivePusherStats * _Nonnull)stats;
@end
/// The <code>IOStream</code> class is the foundation of a RTMPStream.
SWIFT_CLASS("_TtC13SellyCloudSDK8IOStream")
@interface IOStream : NSObject
/// The number of frames per second being displayed.
@property (nonatomic, readonly) uint16_t currentFPS;
/// Creates an object.
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@class NSCoder;
@protocol MTLDevice;
/// A view that displays a video content of a NetStream object which uses Metal api.
SWIFT_CLASS("_TtC13SellyCloudSDK8MTHKView")
@interface MTHKView : MTKView
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
- (void)drawRect:(CGRect)rect;
- (nonnull instancetype)initWithFrame:(CGRect)frameRect device:(id <MTLDevice> _Nullable)device SWIFT_UNAVAILABLE;
@end
/// The NetSocket class creates a two-way connection between a client and a server as a client. This class is wrapper for a InputStream and an OutputStream.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetSocket")
@interface NetSocket : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
/// The NetClient class creates a two-way connection between a NetService.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetClient")
@interface NetClient : NetSocket
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
/// The NetService class creates a two-way connection between a client and a server as a server.
SWIFT_CLASS("_TtC13SellyCloudSDK10NetService")
@interface NetService : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
@class NSNetService;
@class NSInputStream;
@class NSOutputStream;
@interface NetService (SWIFT_EXTENSION(SellyCloudSDK)) <NSNetServiceDelegate>
- (void)netService:(NSNetService * _Nonnull)sender didAcceptConnectionWithInputStream:(NSInputStream * _Nonnull)inputStream outputStream:(NSOutputStream * _Nonnull)outputStream;
@end
@class NSStream;
@interface NetSocket (SWIFT_EXTENSION(SellyCloudSDK)) <NSStreamDelegate>
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
@end
@class AVSampleBufferDisplayLayer;
/// A view that displays a video content of a NetStream object which uses AVSampleBufferDisplayLayer api.
SWIFT_CLASS("_TtC13SellyCloudSDK9PiPHKView")
@interface PiPHKView : UIView
/// Returns the class used to create the layer for instances of this class.
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layerClass;)
+ (Class _Nonnull)layerClass SWIFT_WARN_UNUSED_RESULT;
/// The views Core Animation layer used for rendering.
@property (nonatomic, readonly, strong) AVSampleBufferDisplayLayer * _Nonnull layer;
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
@end
/// An object that provides the interface to control a one-way channel over a RtmpConnection.
SWIFT_CLASS("_TtC13SellyCloudSDK10RTMPStream")
@interface RTMPStream : IOStream
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#endif // defined(__OBJC__)
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__cplusplus)
#endif
#pragma clang diagnostic pop
#endif
#else
#error unsupported Swift architecture
#endif

View File

@@ -0,0 +1,38 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "SellyCloudSDKError.h"
#import "SellyLiveAudioConfiguration.h"
#import "SellyLivePlayerDelegate.h"
#import "SellyLivePlayerStats.h"
#import "SellyLivePusherDelegate.h"
#import "SellyLivePusherStats.h"
#import "SellyLiveVideoConfiguration.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyLiveVideoPusher.h"
#import "SellyPlayerStreamInfo.h"
#import "SellyPublicDefinition.h"
#import "SellyRTCReplayKitHandler.h"
#import "SellyRTCSession.h"
#import "SellyRTCSessionDelegate.h"
#import "SellyRTCStats.h"
#import "SellyRtcVideoCanvas.h"
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCVideoFrame.h"
#import "SellyVodPlayerDelegate.h"
#import "SellyVodVideoPlayer.h"
#import "SellyCloudManager.h"
#import "LFLiveDebug.h"
FOUNDATION_EXPORT double SellyCloudSDKVersionNumber;
FOUNDATION_EXPORT const unsigned char SellyCloudSDKVersionString[];

View File

@@ -0,0 +1,170 @@
//
// SellyCloudSDKError.h
// SellyCloudSDK
//
// Created on 19/12/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Error Domain
/// SellyCloudSDK 错误域
FOUNDATION_EXPORT NSErrorDomain const SellyCloudSDKErrorDomain;
#pragma mark - Error Code Ranges
/*
错误代码范围规划:
1000-1999: 通用错误(参数校验、配置错误等)
2000-2999: 直播推流相关错误
3000-3999: 视频播放相关错误
4000-4999: 网络请求相关错误
5000-5999: 信令相关错误WebSocket、RTC信令
6000-6999: 音视频会议相关错误
7000-7999: 媒体设备相关错误
8000-8999: 编解码相关错误
9000-9999: 预留
*/
#pragma mark - Common Errors (1000-1999)
typedef NS_ENUM(NSInteger, SellyCloudSDKErrorCode) {
// MARK: - 通用错误 (1000-1999)
/// 通用错误(具体错误见描述)
SellyCloudSDKErrorCodeGeneral = 1000,
/// 参数为空
SellyCloudSDKErrorCodeEmptyParameter = 1001,
/// 配置错误
SellyCloudSDKErrorCodeInvalidConfiguration = 1002,
/// SDK 未初始化
SellyCloudSDKErrorCodeNotInitialized = 1003,
/// 操作不支持
SellyCloudSDKErrorCodeOperationNotSupported = 1004,
/// 重复操作
SellyCloudSDKErrorCodeDuplicateOperation = 1005,
// MARK: - 直播推流错误 (2000-2999)
/// URL/StreamID 不能为空
SellyCloudSDKErrorCodePushURLEmpty = 2000,
/// 预览窗口不能为空
SellyCloudSDKErrorCodePreviewEmpty = 2001,
/// 语音直播下无法开启相机
SellyCloudSDKErrorCodeCannotStartCameraInAudioMode = 2002,
/// 推流已经在运行
SellyCloudSDKErrorCodePushAlreadyRunning = 2003,
/// 推流未运行
SellyCloudSDKErrorCodePushNotRunning = 2004,
/// 推流连接失败
SellyCloudSDKErrorCodePushConnectionFailed = 2005,
/// 推流断开连接
SellyCloudSDKErrorCodePushDisconnected = 2006,
/// 推流超时
SellyCloudSDKErrorCodePushTimeout = 2007,
// MARK: - 视频播放错误 (3000-3999)
/// 播放 URL 为空
SellyCloudSDKErrorCodePlayURLEmpty = 3000,
/// 播放器初始化失败
SellyCloudSDKErrorCodePlayerInitFailed = 3001,
/// 播放失败
SellyCloudSDKErrorCodePlaybackFailed = 3002,
/// 播放超时
SellyCloudSDKErrorCodePlaybackTimeout = 3003,
// MARK: - 网络请求错误 (4000-4999)
/// AppKey/Name 未初始化
SellyCloudSDKErrorCodeAppKeyNotInitialized = 4000,
/// 网络请求失败
SellyCloudSDKErrorCodeNetworkRequestFailed = 4001,
/// 网络连接超时
SellyCloudSDKErrorCodeNetworkTimeout = 4002,
/// 服务器返回错误
SellyCloudSDKErrorCodeServerError = 4003,
/// 数据解析失败
SellyCloudSDKErrorCodeDataParseFailed = 4004,
// MARK: - 信令相关错误 (5000-5999)
/// WebSocket 连接失败
SellyCloudSDKErrorCodeWebSocketConnectionFailed = 5000,
/// WebSocket 断开连接
SellyCloudSDKErrorCodeWebSocketDisconnected = 5001,
/// 信令超时无响应
SellyCloudSDKErrorCodeSignalNoACK = 5002,
/// 信令消息为空
SellyCloudSDKErrorCodeSignalMessageEmpty = 5003,
/// 信令消息格式错误
SellyCloudSDKErrorCodeSignalMessageInvalid = 5004,
// MARK: - 音视频会议错误 (6000-6999)
/// RTC 连接失败
SellyCloudSDKErrorCodeRTCConnectionFailed = 6000,
/// RTC 会议创建失败
SellyCloudSDKErrorCodeRTCSessionCreateFailed = 6001,
/// RTC 对等连接失败
SellyCloudSDKErrorCodeRTCP2PConnectionFailed = 6002,
/// 加入房间失败
SellyCloudSDKErrorCodeJoinRoomFailed = 6003,
/// 离开房间失败
SellyCloudSDKErrorCodeLeaveRoomFailed = 6004,
// MARK: - 媒体设备错误 (7000-7999)
/// 相机权限被拒绝
SellyCloudSDKErrorCodeCameraPermissionDenied = 7000,
/// 麦克风权限被拒绝
SellyCloudSDKErrorCodeMicrophonePermissionDenied = 7001,
/// 相机不可用
SellyCloudSDKErrorCodeCameraUnavailable = 7002,
/// 麦克风不可用
SellyCloudSDKErrorCodeMicrophoneUnavailable = 7003,
/// 设备占用
SellyCloudSDKErrorCodeDeviceBusy = 7004,
// MARK: - 编解码错误 (8000-8999)
/// 编码器初始化失败
SellyCloudSDKErrorCodeEncoderInitFailed = 8000,
/// 解码器初始化失败
SellyCloudSDKErrorCodeDecoderInitFailed = 8001,
/// 编码失败
SellyCloudSDKErrorCodeEncodeFailed = 8002,
/// 解码失败
SellyCloudSDKErrorCodeDecodeFailed = 8003,
};
#pragma mark - Error UserInfo Keys
/// 错误的详细描述 key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorDescriptionKey;
/// 错误的恢复建议 key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorRecoverySuggestionKey;
/// 底层错误如系统错误、第三方库错误key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorUnderlyingErrorKey;
/// 服务端原始错误码 key用于调试和日志记录
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorServerCodeKey;
#pragma mark - Error Creation Helper
/// 创建 SellyCloudSDK 错误的便捷方法
FOUNDATION_EXPORT NSError * SellyCloudSDKError(NSInteger code, NSString *description);
/// 创建带底层错误的 SellyCloudSDK 错误
FOUNDATION_EXPORT NSError * SellyCloudSDKErrorWithUnderlying(NSInteger code, NSString *description, NSError * _Nullable underlyingError);
/// 创建服务端错误(包含服务端原始错误码)
FOUNDATION_EXPORT NSError * SellyCloudSDKServerError(NSInteger serverCode, NSString *description);
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,73 @@
//
// SellyLiveAudioConfiguration.h
// SellyCloudLiveKit
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
/// 音频码率 (默认96Kbps)
typedef NS_ENUM (NSUInteger, SellyLiveAudioBitRate) {
/// 32Kbps 音频码率
SellyLiveAudioBitRate_32Kbps = 32000,
/// 64Kbps 音频码率
SellyLiveAudioBitRate_64Kbps = 64000,
/// 96Kbps 音频码率
SellyLiveAudioBitRate_96Kbps = 96000,
/// 128Kbps 音频码率
SellyLiveAudioBitRate_128Kbps = 128000,
/// 默认音频码率,默认为 96Kbps
SellyLiveAudioBitRate_Default = SellyLiveAudioBitRate_96Kbps
};
/// 音频采样率 (默认44.1KHz)
typedef NS_ENUM (NSUInteger, SellyLiveAudioSampleRate){
/// 16KHz 采样率
SellyLiveAudioSampleRate_16000Hz = 16000,
/// 44.1KHz 采样率
SellyLiveAudioSampleRate_44100Hz = 44100,
/// 48KHz 采样率
SellyLiveAudioSampleRate_48000Hz = 48000,
/// 默认音频采样率,默认为 44.1KHz
SellyLiveAudioSampleRate_Default = SellyLiveAudioSampleRate_44100Hz
};
/// Audio Live quality音频质量
typedef NS_ENUM (NSUInteger, SellyLiveAudioQuality){
/// 低音频质量 audio sample rate: 16KHz audio bitrate: numberOfChannels 1 : 32Kbps 2 : 64Kbps
SellyLiveAudioQuality_Low = 0,
/// 中音频质量 audio sample rate: 44.1KHz audio bitrate: 96Kbps
SellyLiveAudioQuality_Medium = 1,
/// 高音频质量 audio sample rate: 44.1MHz audio bitrate: 128Kbps
SellyLiveAudioQuality_High = 2,
/// 超高音频质量 audio sample rate: 48KHz, audio bitrate: 128Kbps
SellyLiveAudioQuality_VeryHigh = 3,
/// 默认音频质量 audio sample rate: 44.1KHz, audio bitrate: 96Kbps
SellyLiveAudioQuality_Default = SellyLiveAudioQuality_High
};
@interface SellyLiveAudioConfiguration : NSObject<NSCoding, NSCopying>
/// 默认音频配置
+ (instancetype)defaultConfiguration;
/// 音频配置
+ (instancetype)defaultConfigurationForQuality:(SellyLiveAudioQuality)audioQuality;
#pragma mark - Attribute
///=============================================================================
/// @name Attribute
///=============================================================================
/// 声道数目(default 2)
@property (nonatomic, assign) NSUInteger numberOfChannels;
/// 采样率
@property (nonatomic, assign) SellyLiveAudioSampleRate audioSampleRate;
/// 码率
@property (nonatomic, assign) SellyLiveAudioBitRate audioBitrate;
/// flv编码音频头 44100 为0x12 0x10
@property (nonatomic, assign, readonly) char *asc;
/// 缓存区长度
@property (nonatomic, assign,readonly) NSUInteger bufferLength;
@end

View File

@@ -0,0 +1,69 @@
//
// SellyPlayerDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 14/7/25.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyRTCVideoFrame.h"
#import "SellyLivePlayerStats.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SellyLivePlayerDelegate <NSObject>
@optional
/**
SellyCloudMPMovieFinishReason
*/
- (void)player:(SellyLiveVideoPlayer *)player playbackDidFinished:(NSDictionary *)resultInfo;
- (void)player:(SellyLiveVideoPlayer *)player playbackStateChanged:(SellyPlayerState)state;
/**
首帧视频完成加载
@param elapse 调用play到加载完成耗时ms
*/
- (void)player:(SellyLiveVideoPlayer *)player firstRemoteVideoFrame:(NSInteger)elapse;
/**
首帧音频完成加载
@param elapse 调用play到加载完成耗时ms
*/
- (void)player:(SellyLiveVideoPlayer *)player firstRemoteAudioFrame:(NSInteger)elapse;
/**
追帧开始
@param rate 追帧速率
*/
- (void)player:(SellyLiveVideoPlayer *)player onFrameCatchingStart:(CGFloat)rate;
/**
追帧结束
*/
- (void)playerDidEndFrameCatching:(SellyLiveVideoPlayer *)player;
- (void)player:(SellyLiveVideoPlayer *)player onError:(NSError *)error;
/**
视频帧渲染回调
@param player 播放器实例
@param videoFrame 视频帧数据
@return 是否继续处理该帧
* - YES: 不忽略该帧
* - NO: 忽略该帧,不会继续渲染
*/
- (BOOL)player:(SellyLiveVideoPlayer *)player onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame;
/**
播放器调试信息回调
@param player 播放器实例
@param stats 播放器统计信息,包含各种性能指标和调试数据
*/
- (void)player:(SellyLiveVideoPlayer *)player onDebugInfo:(SellyLivePlayerStats *)stats;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,51 @@
//
// SellyLivePlayerStats.h
// SellyCloudSDK
//
// Created by Caleb on 26/1/13.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyLivePlayerStats : NSObject <NSCopying>
/// 播放协议RTMP/HLS/WebRTC等
@property (nonatomic, strong) NSString *protocol;
/// App / System CPU%
@property (nonatomic, assign) NSUInteger appCpu;
@property (nonatomic, assign) NSUInteger systemCpu;
/// 视频帧率fps
@property (nonatomic, assign) NSInteger fps;
/// 视频 / 音频码率kbps
@property (nonatomic, assign) NSInteger videoBitrate;
@property (nonatomic, assign) NSInteger audioBitrate;
/// 总下行速率kbps等于 videoBitrate + audioBitrate
@property (nonatomic, assign) NSInteger netSpeed;
/// RTT - 往返时延ms
@property (nonatomic, assign) NSInteger rtt;
/// 视频分辨率
@property (nonatomic, assign) CGSize videoSize;
/// 快照时间ms since boot
@property (nonatomic, assign) uint64_t timestampMs;
/// 是否正在loading
@property (nonatomic, assign) BOOL isLoading;
/// 丢包率(%
@property (nonatomic, assign) CGFloat packetLossRate;
/// 卡顿时间ms- 统计周期内的累积卡顿时长
@property (nonatomic, assign) NSUInteger freezeTime;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,25 @@
//
// SellyCloudRTMPDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 7/7/25.
//
#import <Foundation/Foundation.h>
#import "LFLiveDebug.h"
#import "SellyPublicDefinition.h"
#import "SellyLivePusherStats.h"
NS_ASSUME_NONNULL_BEGIN
@class SellyLiveVideoPusher;
@protocol SellyLivePusherDelegate <NSObject>
@optional
- (void)pusher:(SellyLiveVideoPusher *)pusher liveStatusDidChanged:(SellyLiveState)status;
- (void)pusher:(SellyLiveVideoPusher *)pusher onError:(NSError *)error;
//视频前处理
- (CVPixelBufferRef)pusher:(SellyLiveVideoPusher *)pusher onCaptureVideoFrame:(CVPixelBufferRef)pixelBuffer;
//直播中stats回调
- (void)pusher:(SellyLiveVideoPusher *)pusher onStatisticsUpdate:(SellyLivePusherStats *)stats;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,47 @@
//
// SellyLivePusherStats.h
// AFNetworking
//
// Created by Caleb on 23/9/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyLivePusherStats : NSObject <NSCopying>
//直播协议
@property (nonatomic, strong)NSString *protocol;
/// App / System CPU%
@property (nonatomic, assign) NSUInteger appCpu;
@property (nonatomic, assign) NSUInteger systemCpu;
/// 帧率fps
@property (nonatomic, assign) NSUInteger fps;
/// 视频 / 音频码率kbps
@property (nonatomic, assign) NSUInteger videoBitrate;
@property (nonatomic, assign) NSUInteger audioBitrate;
/// 总上行速率kbps等于videoBitrate+audioBitrate
@property (nonatomic, assign) NSUInteger netSpeed;
/// RTTms
@property (nonatomic, assign) NSUInteger rtt;
/// 丢包率(%
@property (nonatomic, assign) CGFloat packetLossRate;
//卡顿时长
@property (nonatomic, assign) NSInteger freezeTime;
/// 快照时间ms since boot
@property (nonatomic, assign) uint64_t timestampMs;
//videoSize
@property (nonatomic, assign)CGSize size;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,42 @@
//
// SellyLiveVideoConfiguration.h
// SellyCloudLiveKit
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
@interface SellyLiveVideoConfiguration : NSObject <NSCopying>
/// 默认视频配置
+ (instancetype)defaultConfiguration;
#pragma mark - Attribute
///=============================================================================
/// @name Attribute
///=============================================================================
/// 视频输出分辨率,宽高务必设定为 2 的倍数,否则解码播放时可能出现绿边
@property (nonatomic, assign) SellyRTCVideoResolution videoSize;
/// 视频输出方向
@property (nonatomic, assign) UIInterfaceOrientation outputImageOrientation;
/// 视频的帧率,即 fps
@property (nonatomic, assign) NSUInteger videoFrameRate;
/// 视频的最小帧率,即 fps
@property (nonatomic, assign) NSUInteger videoMinFrameRate;
/// 最大关键帧间隔,可设定为 fps 的2倍影响一个 gop 的大小
@property (nonatomic, assign) NSUInteger videoMaxKeyframeInterval;
/// 视频的码率,单位是 bps
@property (nonatomic, assign) NSUInteger videoBitRate;
/// 视频的最小码率,单位是 bps
@property (nonatomic, assign) NSUInteger videoMinBitRate;
@end

View File

@@ -0,0 +1,48 @@
//
// SellyVideoPlayer.h
// SellyCloudSDK
// 直播rtmp、rtc播放器
// Created by Caleb on 17/9/25.
//
#import <Foundation/Foundation.h>
#import "SellyPlayerStreamInfo.h"
@protocol SellyLivePlayerDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface SellyLiveVideoPlayer : NSObject
//接盾的情况下请调用该方法初始化
- (void)startPlayStreamInfo:(SellyPlayerStreamInfo *)streamInfo;
- (void)startPlayUrl:(NSString *)url;
- (void)resume;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
/** 截取当前图片 */
- (UIImage *)getCurrentImage;
/** 设置渲染视图(类似腾讯 V2TXLivePlayer 的 setRenderView:*/
- (void)setRenderView:(nullable UIView *)view;
//业务层需要传入用于显示的容器视图
@property (nonatomic, weak, readonly, nullable)UIView *renderView;
//代理
@property (nonatomic, weak) id<SellyLivePlayerDelegate> delegate;
//音量 静音播放设置0即可
@property (nonatomic, assign) CGFloat playbackVolume;
//播放状态
@property(nonatomic, readonly) SellyPlayerState playbackState;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//token
@property (nonatomic, strong)NSString *token;
/// XOR 解密密钥 (十六进制字符串, 如 @"ABCDEF12")
/// 必须为偶数长度且仅包含 0-9, a-f, A-F传入非法值将抛出 NSInvalidArgumentException 导致 App 崩溃。
/// 传 nil 或空字符串表示不解密。
@property (nonatomic, copy, nullable)NSString *xorKey;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,131 @@
//
// SellyVideoPusher.h
// SellyCloudSDK
//
// Created by Caleb on 18/9/25.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "SellyLivePusherDelegate.h"
#import "SellyPlayerStreamInfo.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyLiveVideoPusher : NSObject
/**
* 初始化直播推流器
*
* @param liveMode 推流协议类型RTMP/RTC 协议。
*/
- (instancetype)initWithLiveMode:(SellyLiveMode)liveMode NS_DESIGNATED_INITIALIZER;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/**
是否开启本地预览镜像
*/
@property (nonatomic, assign)BOOL mirror;
/**
开始采集音视频流程,默认会采集语音和视频
@param captureDevicePosition 使用前置还是后置摄像头
@param videoConfig 视频采集/推流参数传nil将使用默认推流参数
@param audioConfig 音频采集/推流参数传nil将使用默认推流参数
*/
- (void)startRunning:(AVCaptureDevicePosition)captureDevicePosition videoConfig:(nullable SellyLiveVideoConfiguration *)videoConfig audioConfig:(nullable SellyLiveAudioConfiguration *)audioConfig;
/**
纯语音直播调用该方法,开始采集语音流程,不会采集视频
无法在直播中开启视频需要开关摄像头的请调用startRunning:videoConfig:audioConfig:方法
@param audioConfig 音频采集/推流参数传nil将使用默认推流参数
*/
- (void)startRunningAudio:(nullable SellyLiveAudioConfiguration *)audioConfig;
/**
开启视频采集,中途关闭摄像头再次开启需要调用
*/
- (nullable NSError *)startCamera;
/**
停止视频采集,中途关闭摄像头调用
*/
- (void)stopCamera;
/**
切换前后摄像头
*/
- (void)switchCameraPosition:(void (^)(NSError * _Nullable error))completion;
/**
开启音频采集
*/
- (void)startMicrophone;
/**
停止语音采集
*/
- (void)stopMicrophone;
/**
开始推流
@return 返回nil表示流程成功不代表推流成功
@param url 推流地址
*/
- (nullable NSError *)startLiveWithUrl:(NSString *)url;
- (nullable NSError *)startLiveWithStreamId:(NSString *)streamId;
/**
停止推流
*/
- (void)stopLive:(void(^)(NSError *error))callback;
/**
截取当前图片
*/
- (UIImage *)getCurrentImage;
/**
推送静态图片调用1次即可不用循环调用
*/
- (void)pushStaticImage:(UIImage *)image;
/**
停止推送静态图片
*/
- (void)stopPushImage;
/**
本地预览view
*/
@property (nonatomic, strong)UIView *preview;
/**
回调
*/
@property (nonatomic, weak)id<SellyLivePusherDelegate> delegate;
@property (nonatomic, assign, readonly)BOOL isMute;
@property (nonatomic, assign, readonly)BOOL isCameraEnable;
@property (nonatomic, assign, readonly)SellyLiveState liveState;
/**
是否支持视频前置处理,例如实现美颜功能. default no
*/
@property (nonatomic, assign)BOOL enableCustomVideoProcess;
//当前的摄像头方向
@property (nonatomic, assign)AVCaptureDevicePosition captureDevicePosition;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//videoConfig
@property (nonatomic, assign)SellyLiveVideoConfiguration *videoConfig;
//token
@property (nonatomic, strong)NSString *token;
/// XOR 加密密钥 (十六进制字符串, 如 @"ABCDEF12")
/// 必须为偶数长度且仅包含 0-9, a-f, A-F传入非法值将抛出 NSInvalidArgumentException 导致 App 崩溃。
/// 传 nil 或空字符串表示不加密。
@property (nonatomic, copy, nullable)NSString *xorKey;
/// 是否启用 Center Stage人物居中默认 NO
/// 支持运行时动态切换,不支持的设备设置无效
@property (nonatomic, assign) BOOL centerStageEnabled;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,18 @@
//
// SellyPlayerStreamInfo.h
// SellyCloudSDK
//
// Created by Caleb on 18/9/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyPlayerStreamInfo : NSObject
@property (nonatomic, strong)NSString *streamId;
//rtmp,rtc
@property (nonatomic, assign)SellyLiveMode protocol;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,98 @@
//
// SellyPublicDefinition.h
// Pods
//
// Created by Caleb on 22/8/25.
//
#ifndef SellyPublicDefinition_h
#define SellyPublicDefinition_h
//视频输出分辨率
typedef CGSize SellyRTCVideoResolution;
extern SellyRTCVideoResolution const SellyRTCVideoResolution480x360;
extern SellyRTCVideoResolution const SellyRTCVideoResolution480x480;
extern SellyRTCVideoResolution const SellyRTCVideoResolution640x360;
extern SellyRTCVideoResolution const SellyRTCVideoResolution640x480;
extern SellyRTCVideoResolution const SellyRTCVideoResolution960x540;
extern SellyRTCVideoResolution const SellyRTCVideoResolution1280x720;
typedef NS_ENUM(NSInteger, SellyVideoCodecType) {
SellyVideoCodecTypeH264 = 1,
SellyVideoCodecTypeH265 = 2,
};
/**
* 支持协议
*/
typedef NS_ENUM(NSUInteger, SellyLiveMode) {
/// 支持协议: RTMP。
SellyLiveMode_RTMP,
/// 支持协议: TRTC。
SellyLiveMode_RTC
};
typedef NS_ENUM(NSInteger, SellyPlayerScalingMode) {
SellyPlayerScalingModeNone, // No scaling
SellyPlayerScalingModeAspectFit, // Uniform scale until one dimension fits
SellyPlayerScalingModeAspectFill, // Uniform scale until the movie fills the visible bounds. One dimension may have clipped contents
};
typedef NS_ENUM(NSInteger, SellyPlayerState) {
SellyPlayerStateIdle = 0,
SellyPlayerStateConnecting = 1,
SellyPlayerStatePlaying = 2,
SellyPlayerStatePaused = 3,
SellyPlayerStateStoppedOrEnded = 4,
SellyPlayerStateFailed = 5
};
typedef NS_ENUM(NSInteger, SellyCloudMPMovieFinishReason) {
SellyCloudMPMovieFinishReasonPlaybackEnded,
SellyCloudMPMovieFinishReasonPlaybackError,
SellyCloudMPMovieFinishReasonUserExited
};
typedef NS_ENUM(NSInteger, SellyLiveState) {
SellyLiveStateIdle = 0, // 初始/未开始
SellyLiveStateConnecting, // 建立会话RTMP连接 或 SDP/ICE协商中
SellyLiveStatePublishing, // 已在上行推流(码流稳定输出)
SellyLiveStateReconnecting, // 断线重试中(短暂)
SellyLiveStateStopped, // 正常结束stop
SellyLiveStateFailed // 异常结束(错误/不可恢复)
};
typedef NS_ENUM (NSUInteger, SellyCloudLiveSocketErrorCode) {
SellyCloudLiveSocketError_PreView = 201, ///< 预览失败
SellyCloudLiveSocketError_GetStreamInfo = 202, ///< 获取流媒体信息失败
SellyCloudLiveSocketError_ConnectSocket = 203, ///< 连接socket失败
SellyCloudLiveSocketError_Verification = 204, ///< 验证服务器失败
SellyCloudLiveSocketError_ReConnectTimeOut = 205, ///< 重新连接服务器超时
SellyCloudLiveSocketError_HttpRequest = 400, //http请求报错
};
typedef NS_ENUM(NSInteger, SellyVideoCallType) {
SellyVideoCallTypeAudio, // 语音
SellyVideoCallTypeVideo, // 视频
};
//信令连接状态
typedef NS_ENUM(NSInteger, SellyRoomConnectionState) {
SellyRoomStateDisconnected,
SellyRoomStateConnecting,
SellyRoomStateConnected,
SellyRoomStateReconnecting,
SellyRoomStateFailed,
};
//屏幕分享状态
typedef NS_ENUM(uint8_t, SellyScreenShareState) {
SellyScreenShareStateStarted = 1, // 开始
SellyScreenShareStatePaused = 2, // 暂停
SellyScreenShareStateResumed = 3, // 恢复
SellyScreenShareStateStopped = 4, // 结束
};
#endif /* SellyPublicDefinition_h */

View File

@@ -0,0 +1,17 @@
//
// SellyRTCReplayKitHandler.h
// SellyCloudSDK
//
// Created by Caleb on 12/10/25.
//
#import <Foundation/Foundation.h>
#import <ReplayKit/ReplayKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCReplayKitHandler : RPBroadcastSampleHandler
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,99 @@
//
// SellyRTCSession.h
// SellyCloudSDK
//
// Created by Caleb on 17/11/25.
//
#import <Foundation/Foundation.h>
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCSessionDelegate.h"
#import <AVFoundation/AVFoundation.h>
#import "SellyRTCVideoCanvas.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCSession : NSObject
/**
@param isP2p 是否单聊
*/
- (instancetype)initWithType:(BOOL)isP2p;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
@brief 发起通话
*/
- (void)startWithChannelId:(NSString *)channelId token:(NSString *)token;
/// 结束通话
- (void)end;
//是否开启本地视频,默认不开启
- (void)enableLocalVideo:(BOOL)enable;
//是否开启本地音频采集,默认开启
- (void)enableLocalAudio:(BOOL)enable;
//切换前后摄像头
- (void)switchCamera;
/**
* Starts the local video preview before joining a channel.
*
* Once you call this method to start the local video preview, if you leave
* the channel by calling \ref leaveChannel: leaveChannel, the local video
* preview remains until you call \ref stopPreview to disable it.
*/
- (void)startPreview;
/**
* Stops the local video preview and the video.
*/
- (void)stopPreview;
/**
屏蔽对方的声音单聊不用传userId
*/
- (void)muteRemoteAudioStream:(NSString *)userId mute:(BOOL)mute;
/**
@brief 设置声音输出通道
如果没有外接设备(蓝牙,耳机)等,可以直接调用这个方法在听筒和扬声器直接来回切换
如果有外接设备建议直接使用AVRoutePickerView
有外接设备的情况下,无法切换为听筒播放,但是可以切换为扬声器播放
*/
- (void)setAudioOutput:(AVAudioSessionPortOverride)port;
/**
发送自定义消息给对方
*/
- (void)sendMessage:(NSString *)message completion:(nonnull void (^)(NSError * _Nullable))completion;
//本地localView
- (void)setLocalCanvas:(SellyRTCVideoCanvas *)localCanvas;
//远程remoteView
- (void)setRemoteCanvas:(SellyRTCVideoCanvas *)remoteCanvas;
//更新token
- (void)renewToken:(NSString * _Nonnull)token;
//Starts screen sharing.
- (void)startScreenCapture;
//外部推流不使用sdk默认的视频采集
- (void)pushExternalVideoFrame:(CVPixelBufferRef)pixelBuffer;
//
@property (nonatomic, weak)id<SellyRTCSessionDelegate> delegate;
//视频编码设置 需要在startWithChannelId之前调用
@property (nonatomic, strong)SellyRTCVideoConfiguration *videoConfig;
////通话连接状态
@property (nonatomic, assign, readonly)SellyRoomConnectionState connectionState;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,124 @@
//
// SellyRTCSessionDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 5/11/25.
//
#import <Foundation/Foundation.h>
#import "SellyRTCStats.h"
#import "SellyRTCVideoFrame.h"
@class SellyRTCSession;
NS_ASSUME_NONNULL_BEGIN
//流的连接状态
typedef enum : NSUInteger {
SellyRTCConnectStateDisconnected, //断开连接
SellyRTCConnectStateConnecting, //连接中
SellyRTCConnectStateConnected, //连接成功
SellyRTCConnectStateReconnecting, //重连
} SellyRTCConnectState;
@protocol SellyRTCSessionDelegate <NSObject>
@optional
/**
通话报错无法恢复,需要结束流程
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onError:(NSError *)error;
/** A remote user's video was enabled or disabled.
@param enabled Enabled or disabled:
* Yes: User has enabled the video function.
* No: User has disabled the video function.
@param userId Remote user ID.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session videoEnabled:(BOOL)enabled userId:(nullable NSString *)userId;
/** A remote user's audio was enabled or disabled.
@param enabled Enabled or disabled:
* Yes: User has enabled the audio function.
* No: User has disabled the audio function.
@param userId Remote user ID.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session audioEnabled:(BOOL)enabled userId:(nullable NSString *)userId;
/**
收到对方自定义消息
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session didReceiveMessage:(NSString *)message userId:(nullable NSString *)userId;
/**
@brief stream连接状态发生改变
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session connectionStateChanged:(SellyRTCConnectState)state userId:(nullable NSString *)userId;
/**
@brief 会话连接状态发生改变
会话重连期间内ice会持续重启直到超时
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onRoomConnectionStateChanged:(SellyRoomConnectionState)state;
//视频前处理
- (CVPixelBufferRef)rtcSession:(SellyRTCSession * _Nonnull)session onCaptureVideoFrame:(CVPixelBufferRef)pixelBuffer;
/**
* Occurs each time the SDK receives a video frame sent by the remote user.
*
* After you successfully register the video frame observer, the SDK triggers this callback each time a
* video frame is received. In this callback, you can get the video data sent by the remote user. You
* can then post-process the data according to your scenarios.
*
@return Determines whether to ignore the current video frame if the pre-processing fails:
* - true: Do not ignore.
* - false: Ignore, in which case this method does not sent the current video frame to the SDK.
*/
- (BOOL)rtcSession:(SellyRTCSession *)session onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame userId:(NSString *)userId;
/**
统计功能
如果是单聊 userId = nil
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onStats:(SellyRTCStats *)stats userId:(nullable NSString *)userId;
/**
用户加入频道
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onUserJoined:(nullable NSString *)userId;
/**
用户离开频道
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onUserLeave:(nullable NSString *)userId;
/**
通话时长回调
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onDuration:(NSInteger)duration;
/**
收到token将要过期消息
@param token The token that will expire in 60 seconds.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session tokenWillExpire:(NSString *)token;
/**
收到token已过期消息
token过期后依然可以正常通话但是断网重连会失败
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session tokenExpired:(NSString *)token;
/**
屏幕分享状态发生变化
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onScreenShareStatusChanged:(SellyScreenShareState)state;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,49 @@
//
// SellyRTCP2pStats.h
// SellyCloudSDK
//
// Created by Caleb on 10/11/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCStats : NSObject
/// 基本
/// 传输ICE/DTLS
@property(nonatomic, assign) double transportRttMs; // candidate-pair.currentRoundTripTime * 1000
@property(nonatomic, copy, nullable) NSString *relayProtocol; // udp/tcp/tlsTURN时可见
@property(nonatomic, copy) NSString *audioCodec;
@property(nonatomic, copy) NSString *videoCodec;
/// 媒体累计字节
@property(nonatomic, assign) uint64_t txAudioBytes;
@property(nonatomic, assign) uint64_t txVideoBytes;
@property(nonatomic, assign) uint64_t rxAudioBytes;
@property(nonatomic, assign) uint64_t rxVideoBytes;
@property(nonatomic, assign, readonly) uint64_t txBytes; // 汇总
@property(nonatomic, assign, readonly) uint64_t rxBytes;
/// 视频信息(能拿到就填)
@property(nonatomic, assign) double sentFps;
@property(nonatomic, assign) NSInteger sentWidth;
@property(nonatomic, assign) NSInteger sentHeight;
@property(nonatomic, assign) double recvFps;
@property(nonatomic, assign) NSInteger recvWidth;
@property(nonatomic, assign) NSInteger recvHeight;
/// —— 新增:瞬时 Kbps由 Helper 用“前一帧”差分计算)——
@property(nonatomic, assign) double txAudioKbps; // 本次 - 上次 bytes / Δt
@property(nonatomic, assign) double txVideoKbps;
@property(nonatomic, assign) double rxAudioKbps;
@property(nonatomic, assign) double rxVideoKbps;
@property(nonatomic, assign) double txKbps; // = txAudioKbps + txVideoKbps
@property(nonatomic, assign) double rxKbps; // = rxAudioKbps + rxVideoKbps
/// 时间戳(内部用)
@property(nonatomic, assign) NSTimeInterval intervalMs; // 与上次快照的间隔(毫秒),首帧为 0
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// SellyRTCVideoConfiguration.h
// SellyCloudSDK
//
// Created by Caleb on 5/11/25.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoConfiguration : NSObject
//分辨率
@property(assign, nonatomic) SellyRTCVideoResolution resolution;
//帧率
@property(assign, nonatomic) NSInteger frameRate;
//最大码率 bps
@property(assign, nonatomic) NSInteger maxBitrate;
//最小码率 bps
@property(assign, nonatomic) NSInteger minBitrate;
/**
会议模式仅支持h264单聊支持h264h265
*/
@property (nonatomic, assign) SellyVideoCodecType preferCodec;
//默认使用前/后置摄像头
@property (nonatomic, assign)AVCaptureDevicePosition preferPosition;
+ (instancetype)defaultConfig;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// SCSVideoFrame.h
// SellyCloudSDK
//
// Created by Caleb on 19/11/25.
//
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoFrame : NSObject
/// 宽度(像素)
@property (nonatomic, assign) int width;
/// 高度(像素)
@property (nonatomic, assign) int height;
/// 旋转角度0 / 90 / 180 / 270
@property (nonatomic, assign) NSInteger rotation;
/// 时间戳(可选)
@property (nonatomic, assign) int64_t timestamp;
/// 像素数据
@property (nonatomic, assign, nullable) CVPixelBufferRef pixelBuffer;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// SellyRtcVideoCanvas.h
// SellyCloudSDK
//
// Created by Caleb on 11/11/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoCanvas : NSObject
//用户id
@property(strong, nonatomic) NSString *userId;
/**
*The video display view.
*/
@property(strong, nonatomic) UIView *_Nullable view;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,69 @@
//
// SellyVodVideoPlayerDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 07/1/26.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
#import "SellyVodVideoPlayer.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SellyVodPlayerDelegate <NSObject>
@optional
- (void)player:(SellyVodVideoPlayer *)player prepareToPlayChanged:(BOOL)prepare;
/**
播放完成回调
@param resultInfo 包含完成原因SellyCloudMPMovieFinishReason等信息的字典
*/
- (void)player:(SellyVodVideoPlayer *)player playbackDidFinished:(NSDictionary *)resultInfo;
/**
播放状态变化回调
状态流转Idle → Connecting → Playing → Paused/Stopped/Failed
@param state 当前播放状态SellyPlayerState
*/
- (void)player:(SellyVodVideoPlayer *)player playbackStateChanged:(SellyPlayerState)state;
/**
首帧视频完成加载
@param elapse 调用 play 到首帧渲染完成的耗时(毫秒)
*/
- (void)player:(SellyVodVideoPlayer *)player firstRemoteVideoFrame:(NSInteger)elapse;
/**
首帧音频完成加载
@param elapse 调用 play 到首帧音频播放的耗时(毫秒)
*/
- (void)player:(SellyVodVideoPlayer *)player firstRemoteAudioFrame:(NSInteger)elapse;
/**
播放进度更新回调每秒触发一次适合更新UI进度条
注意:
- 如果需要总时长,请访问 player.duration 属性(一次性获取即可)
- 如果你只需要偶尔获取进度,建议直接读取 player.currentPlaybackTime 属性,避免不必要的回调
@param currentTime 当前播放时间(秒)
*/
- (void)player:(SellyVodVideoPlayer *)player playbackProgressChanged:(NSTimeInterval)currentTime;
/**
缓冲进度更新回调(当缓冲区发生变化时触发)
注意:
- 如果需要总时长,请访问 player.duration 属性(一次性获取即可)
- 如果你只需要偶尔获取缓冲进度,建议直接读取 player.playableDuration 属性
@param playableDuration 已缓冲的可播放时长(秒)
*/
- (void)player:(SellyVodVideoPlayer *)player bufferProgressChanged:(NSTimeInterval)playableDuration;
/**
错误回调
@param error 错误信息
*/
- (void)player:(SellyVodVideoPlayer *)player onError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,58 @@
//
// SellyVodVideoPlayer.h
// SellyCloudSDK
// 点播播放器
// Created by Caleb on 1/7/26.
//
#import <Foundation/Foundation.h>
@protocol SellyVodPlayerDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface SellyVodVideoPlayer : NSObject
/**
点播开始播放视频
@param url 播放地址,支持以下格式:
- 网络地址http(s)://xxx.mp4
- 本地文件路径:/var/mobile/.../video.mp4
- 本地文件URLfile:///var/mobile/.../video.mp4
*/
- (void)startPlayUrl:(NSString *)url;
- (void)resume;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
/** 截取当前图片 */
- (UIImage *)getCurrentImage;
/** 设置渲染视图*/
- (void)setRenderView:(nullable UIView *)view;
//业务层需要传入用于显示的容器视图
@property (nonatomic, weak, readonly, nullable)UIView *renderView;
//代理
@property (nonatomic, weak) id<SellyVodPlayerDelegate> delegate;
//音量 静音播放设置0即可
@property (nonatomic, assign) CGFloat playbackVolume;
//播放状态
@property(nonatomic, readonly) SellyPlayerState playbackState;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//是否自动开始播放默认true
@property(nonatomic) BOOL shouldAutoplay;
//视频时长
@property(nonatomic, readonly) NSTimeInterval duration;
//可播放时长
@property(nonatomic, readonly) NSTimeInterval playableDuration;
//当前播放进度
@property(nonatomic) NSTimeInterval currentPlaybackTime;
@property(nonatomic, readonly) BOOL isPreparedToPlay;
//播放速率
@property(nonatomic) float playbackRate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,10 @@
framework module SellyCloudSDK {
umbrella header "SellyCloudSDK-umbrella.h"
export *
module * { export * }
}
module SellyCloudSDK.Swift {
header "SellyCloudSDK-Swift.h"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,40 @@
//
// LFLiveDebug.h
// LaiFeng
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface LFLiveDebug : NSObject
@property (nonatomic, copy) NSString *streamId; ///< 流id
@property (nonatomic, copy) NSString *uploadUrl; ///< 流地址
@property (nonatomic, assign) CGSize videoSize; ///< 上传的分辨率
@property (nonatomic, assign) BOOL isRtmp; ///< 上传方式TCP or RTMP
@property (nonatomic, assign) CGFloat elapsedMilli; ///< 距离上次统计的时间 单位ms
@property (nonatomic, assign) CGFloat timeStamp; ///< 当前的时间戳从而计算1s内数据
@property (nonatomic, assign) CGFloat dataFlow; ///< 总流量
@property (nonatomic, assign) CGFloat bandwidth; ///< 1s内总带宽
@property (nonatomic, assign) CGFloat currentBandwidth; ///< 上次的带宽
@property (nonatomic, assign) CGFloat audioBandwidth;
@property (nonatomic, assign) CGFloat videoBandwidth;
@property (nonatomic, assign) CGFloat currentAudioBandwidth;
@property (nonatomic, assign) CGFloat currentVideoBandwidth;
@property (nonatomic, assign) NSInteger dropFrame; ///< 丢掉的帧数
@property (nonatomic, assign) NSInteger totalFrame; ///< 总帧数
@property (nonatomic, assign) NSInteger capturedAudioCount; ///< 1s内音频捕获个数
@property (nonatomic, assign) NSInteger capturedVideoCount; ///< 1s内视频捕获个数
@property (nonatomic, assign) NSInteger currentCapturedAudioCount; ///< 上次的音频捕获个数
@property (nonatomic, assign) NSInteger currentCapturedVideoCount; ///< 上次的视频捕获个数
@property (nonatomic, assign) NSInteger unSendCount; ///< 未发送个数(代表当前缓冲区等待发送的)
@end

View File

@@ -0,0 +1,47 @@
//
// SellyCloudManager.h
// SellyCloudSDK
//
// Created by Caleb on 7/7/25.
//
#import <Foundation/Foundation.h>
#import "SellyLiveVideoConfiguration.h"
#import "SellyLiveAudioConfiguration.h"
#import "SellyLivePusherDelegate.h"
#import "SellyLivePlayerDelegate.h"
#import "LFLiveDebug.h"
#import "SellyPublicDefinition.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyLiveVideoPusher.h"
#import "SellyLivePusherStats.h"
#import "SellyRTCSession.h"
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCSessionDelegate.h"
#import "SellyRTCReplayKitHandler.h"
#import "SellyCloudSDKError.h"
#import "SellyVodVideoPlayer.h"
#import "SellyVodPlayerDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyCloudManager : NSObject
+ (instancetype)sharedInstance;
//用户id
@property (nonatomic, strong)NSString *userId;
- (void)startWithVHost:(NSString *)vhost appName:(NSString *)appName;
/**
设置代理服务器地址(如洋葱盾转化后的地址)
@param address 代理地址,格式如 http://127.0.0.1:12345
*/
+ (void)setProxyAddress:(NSString *)address;
+ (NSString *)sdkVersion;
+ (void)uploadLog:(void(^)(NSString * _Nullable url, NSError * _Nullable error))callback;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,998 @@
#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
#ifndef SELLYCLOUDSDK_SWIFT_H
#define SELLYCLOUDSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#if defined(__OBJC__)
#include <Foundation/Foundation.h>
#endif // defined(__OBJC__)
#if defined(__cplusplus)
#include <cstdint>
#include <cstddef>
#include <cstdbool>
#include <cstring>
#include <stdlib.h>
#include <new>
#include <type_traits>
#else
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#endif
#if defined(__cplusplus)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
# include <ptrauth.h>
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
# ifndef __ptrauth_swift_value_witness_function_pointer
# define __ptrauth_swift_value_witness_function_pointer(x)
# endif
# ifndef __ptrauth_swift_class_method_pointer
# define __ptrauth_swift_class_method_pointer(x)
# endif
#pragma clang diagnostic pop
#endif
#pragma clang diagnostic pop
#endif
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef unsigned char char8_t;
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if !defined(SWIFT_RUNTIME_NAME)
# if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
# else
# define SWIFT_RUNTIME_NAME(X)
# endif
#endif
#if !defined(SWIFT_COMPILE_NAME)
# if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
# else
# define SWIFT_COMPILE_NAME(X)
# endif
#endif
#if !defined(SWIFT_METHOD_FAMILY)
# if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
# else
# define SWIFT_METHOD_FAMILY(X)
# endif
#endif
#if !defined(SWIFT_NOESCAPE)
# if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
# else
# define SWIFT_NOESCAPE
# endif
#endif
#if !defined(SWIFT_RELEASES_ARGUMENT)
# if __has_attribute(ns_consumed)
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
# else
# define SWIFT_RELEASES_ARGUMENT
# endif
#endif
#if !defined(SWIFT_WARN_UNUSED_RESULT)
# if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
# else
# define SWIFT_WARN_UNUSED_RESULT
# endif
#endif
#if !defined(SWIFT_NORETURN)
# if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
# else
# define SWIFT_NORETURN
# endif
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
# else
# define SWIFT_ENUM(_type, _name, _extensibility) _type _name; enum
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM_TAG)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_TAG enum
# else
# define SWIFT_ENUM_TAG
# endif
#endif
#if !defined(SWIFT_ENUM_FWD_DECL)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_FWD_DECL(_type, _name) enum _name : _type;
# else
# define SWIFT_ENUM_FWD_DECL(_type, _name) typedef _type _name;
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_AVAILABILITY_DOMAIN)
# define SWIFT_AVAILABILITY_DOMAIN(dom, ...) __attribute__((availability(domain: dom, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED_OBJC)
# if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
# else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
# endif
#endif
#if defined(__OBJC__)
#if !defined(IBSegueAction)
# define IBSegueAction
#endif
#endif
#if !defined(SWIFT_EXTERN)
# if defined(__cplusplus)
# define SWIFT_EXTERN extern "C"
# else
# define SWIFT_EXTERN extern
# endif
#endif
#if !defined(SWIFT_CALL)
# define SWIFT_CALL __attribute__((swiftcall))
#endif
#if !defined(SWIFT_INDIRECT_RESULT)
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
#endif
#if !defined(SWIFT_CONTEXT)
# define SWIFT_CONTEXT __attribute__((swift_context))
#endif
#if !defined(SWIFT_ERROR_RESULT)
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
#endif
#if defined(__cplusplus)
# define SWIFT_NOEXCEPT noexcept
#else
# define SWIFT_NOEXCEPT
#endif
#if !defined(SWIFT_C_INLINE_THUNK)
# if __has_attribute(always_inline)
# if __has_attribute(nodebug)
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
# else
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
# endif
# else
# define SWIFT_C_INLINE_THUNK inline
# endif
#endif
#if defined(_WIN32)
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
#endif
#else
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL
#endif
#endif
#if !__has_feature(nullability)
# define _Nonnull
# define _Nullable
# define _Null_unspecified
#elif !defined(__OBJC__)
# pragma clang diagnostic ignored "-Wnullability-extension"
#endif
#if !__has_feature(nullability_nullable_result)
# define _Nullable_result _Nullable
#endif
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
} // extern "C"
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__OBJC__)
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import AVFoundation;
@import CoreFoundation;
@import Foundation;
@import MetalKit;
@import ObjectiveC;
@import UIKit;
#endif
#endif // defined(__OBJC__)
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__OBJC__)
@class UIView;
@protocol HKRtmpPusherProtocol;
@class SellyLiveVideoConfiguration;
@class SellyLiveAudioConfiguration;
@class NSString;
SWIFT_CLASS("_TtC13SellyCloudSDK12HKRtmpPusher")
@interface HKRtmpPusher : NSObject
@property (nonatomic, strong) UIView * _Nullable preview;
@property (nonatomic) NSInteger reconnectInterval;
@property (nonatomic) NSInteger reconnectCount;
@property (nonatomic, strong) id <HKRtmpPusherProtocol> _Nullable delegate;
@property (nonatomic) enum AVCaptureDevicePosition currentPosition;
@property (nonatomic) BOOL muted;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (void)startRunning:(enum AVCaptureDevicePosition)captureDevicePosition videoConfig:(SellyLiveVideoConfiguration * _Nonnull)videoConfig audioConfig:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startRunningAudio:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startLive:(NSString * _Nonnull)urlStr;
- (void)stopLive;
- (void)startCamera;
- (void)stopCamera;
- (void)switchCamera;
- (void)setPreviewView:(UIView * _Nonnull)view;
@end
@class SellyLivePusherStats;
SWIFT_PROTOCOL("_TtP13SellyCloudSDK20HKRtmpPusherProtocol_")
@protocol HKRtmpPusherProtocol
///
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onPushStatusChanged:(NSString * _Nonnull)status;
@optional
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onLiveStatsChanged:(SellyLivePusherStats * _Nonnull)stats;
@end
/// The <code>IOStream</code> class is the foundation of a RTMPStream.
SWIFT_CLASS("_TtC13SellyCloudSDK8IOStream")
@interface IOStream : NSObject
/// The number of frames per second being displayed.
@property (nonatomic, readonly) uint16_t currentFPS;
/// Creates an object.
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@class NSCoder;
@protocol MTLDevice;
/// A view that displays a video content of a NetStream object which uses Metal api.
SWIFT_CLASS("_TtC13SellyCloudSDK8MTHKView")
@interface MTHKView : MTKView
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
- (void)drawRect:(CGRect)rect;
- (nonnull instancetype)initWithFrame:(CGRect)frameRect device:(id <MTLDevice> _Nullable)device SWIFT_UNAVAILABLE;
@end
/// The NetSocket class creates a two-way connection between a client and a server as a client. This class is wrapper for a InputStream and an OutputStream.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetSocket")
@interface NetSocket : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
/// The NetClient class creates a two-way connection between a NetService.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetClient")
@interface NetClient : NetSocket
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
/// The NetService class creates a two-way connection between a client and a server as a server.
SWIFT_CLASS("_TtC13SellyCloudSDK10NetService")
@interface NetService : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
@class NSNetService;
@class NSInputStream;
@class NSOutputStream;
@interface NetService (SWIFT_EXTENSION(SellyCloudSDK)) <NSNetServiceDelegate>
- (void)netService:(NSNetService * _Nonnull)sender didAcceptConnectionWithInputStream:(NSInputStream * _Nonnull)inputStream outputStream:(NSOutputStream * _Nonnull)outputStream;
@end
@class NSStream;
@interface NetSocket (SWIFT_EXTENSION(SellyCloudSDK)) <NSStreamDelegate>
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
@end
@class AVSampleBufferDisplayLayer;
/// A view that displays a video content of a NetStream object which uses AVSampleBufferDisplayLayer api.
SWIFT_CLASS("_TtC13SellyCloudSDK9PiPHKView")
@interface PiPHKView : UIView
/// Returns the class used to create the layer for instances of this class.
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layerClass;)
+ (Class _Nonnull)layerClass SWIFT_WARN_UNUSED_RESULT;
/// The views Core Animation layer used for rendering.
@property (nonatomic, readonly, strong) AVSampleBufferDisplayLayer * _Nonnull layer;
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
@end
/// An object that provides the interface to control a one-way channel over a RtmpConnection.
SWIFT_CLASS("_TtC13SellyCloudSDK10RTMPStream")
@interface RTMPStream : IOStream
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#endif // defined(__OBJC__)
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__cplusplus)
#endif
#pragma clang diagnostic pop
#endif
#elif defined(__x86_64__) && __x86_64__
// Generated by Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.0.123.5 clang-2100.0.123.102)
#ifndef SELLYCLOUDSDK_SWIFT_H
#define SELLYCLOUDSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"
#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif
#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif
#pragma clang diagnostic ignored "-Wauto-import"
#if defined(__OBJC__)
#include <Foundation/Foundation.h>
#endif // defined(__OBJC__)
#if defined(__cplusplus)
#include <cstdint>
#include <cstddef>
#include <cstdbool>
#include <cstring>
#include <stdlib.h>
#include <new>
#include <type_traits>
#else
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#endif
#if defined(__cplusplus)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
# include <ptrauth.h>
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
# ifndef __ptrauth_swift_value_witness_function_pointer
# define __ptrauth_swift_value_witness_function_pointer(x)
# endif
# ifndef __ptrauth_swift_class_method_pointer
# define __ptrauth_swift_class_method_pointer(x)
# endif
#pragma clang diagnostic pop
#endif
#pragma clang diagnostic pop
#endif
#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
# include <uchar.h>
# elif !defined(__cplusplus)
typedef unsigned char char8_t;
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2 __attribute__((__ext_vector_type__(2)));
typedef float swift_float3 __attribute__((__ext_vector_type__(3)));
typedef float swift_float4 __attribute__((__ext_vector_type__(4)));
typedef double swift_double2 __attribute__((__ext_vector_type__(2)));
typedef double swift_double3 __attribute__((__ext_vector_type__(3)));
typedef double swift_double4 __attribute__((__ext_vector_type__(4)));
typedef int swift_int2 __attribute__((__ext_vector_type__(2)));
typedef int swift_int3 __attribute__((__ext_vector_type__(3)));
typedef int swift_int4 __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4)));
#endif
#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
# define SWIFT_CLASS_PROPERTY(...)
# endif
#endif
#if !defined(SWIFT_RUNTIME_NAME)
# if __has_attribute(objc_runtime_name)
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
# else
# define SWIFT_RUNTIME_NAME(X)
# endif
#endif
#if !defined(SWIFT_COMPILE_NAME)
# if __has_attribute(swift_name)
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
# else
# define SWIFT_COMPILE_NAME(X)
# endif
#endif
#if !defined(SWIFT_METHOD_FAMILY)
# if __has_attribute(objc_method_family)
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
# else
# define SWIFT_METHOD_FAMILY(X)
# endif
#endif
#if !defined(SWIFT_NOESCAPE)
# if __has_attribute(noescape)
# define SWIFT_NOESCAPE __attribute__((noescape))
# else
# define SWIFT_NOESCAPE
# endif
#endif
#if !defined(SWIFT_RELEASES_ARGUMENT)
# if __has_attribute(ns_consumed)
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
# else
# define SWIFT_RELEASES_ARGUMENT
# endif
#endif
#if !defined(SWIFT_WARN_UNUSED_RESULT)
# if __has_attribute(warn_unused_result)
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
# else
# define SWIFT_WARN_UNUSED_RESULT
# endif
#endif
#if !defined(SWIFT_NORETURN)
# if __has_attribute(noreturn)
# define SWIFT_NORETURN __attribute__((noreturn))
# else
# define SWIFT_NORETURN
# endif
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
# define OBJC_DESIGNATED_INITIALIZER
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if __has_attribute(enum_extensibility)
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
# define SWIFT_ENUM_ATTR(_extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
# else
# define SWIFT_ENUM(_type, _name, _extensibility) _type _name; enum
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_ENUM_TAG)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_TAG enum
# else
# define SWIFT_ENUM_TAG
# endif
#endif
#if !defined(SWIFT_ENUM_FWD_DECL)
# if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || __has_feature(objc_fixed_enum)
# define SWIFT_ENUM_FWD_DECL(_type, _name) enum _name : _type;
# else
# define SWIFT_ENUM_FWD_DECL(_type, _name) typedef _type _name;
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_AVAILABILITY_DOMAIN)
# define SWIFT_AVAILABILITY_DOMAIN(dom, ...) __attribute__((availability(domain: dom, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED_OBJC)
# if __has_feature(attribute_diagnose_if_objc)
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
# else
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
# endif
#endif
#if defined(__OBJC__)
#if !defined(IBSegueAction)
# define IBSegueAction
#endif
#endif
#if !defined(SWIFT_EXTERN)
# if defined(__cplusplus)
# define SWIFT_EXTERN extern "C"
# else
# define SWIFT_EXTERN extern
# endif
#endif
#if !defined(SWIFT_CALL)
# define SWIFT_CALL __attribute__((swiftcall))
#endif
#if !defined(SWIFT_INDIRECT_RESULT)
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
#endif
#if !defined(SWIFT_CONTEXT)
# define SWIFT_CONTEXT __attribute__((swift_context))
#endif
#if !defined(SWIFT_ERROR_RESULT)
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
#endif
#if defined(__cplusplus)
# define SWIFT_NOEXCEPT noexcept
#else
# define SWIFT_NOEXCEPT
#endif
#if !defined(SWIFT_C_INLINE_THUNK)
# if __has_attribute(always_inline)
# if __has_attribute(nodebug)
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
# else
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
# endif
# else
# define SWIFT_C_INLINE_THUNK inline
# endif
#endif
#if defined(_WIN32)
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
#endif
#else
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL
#endif
#endif
#if !__has_feature(nullability)
# define _Nonnull
# define _Nullable
# define _Null_unspecified
#elif !defined(__OBJC__)
# pragma clang diagnostic ignored "-Wnullability-extension"
#endif
#if !__has_feature(nullability_nullable_result)
# define _Nullable_result _Nullable
#endif
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(__cplusplus)
} // extern "C"
#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__OBJC__)
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import AVFoundation;
@import CoreFoundation;
@import Foundation;
@import MetalKit;
@import ObjectiveC;
@import UIKit;
#endif
#endif // defined(__OBJC__)
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="SellyCloudSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif
#if defined(__OBJC__)
@class UIView;
@protocol HKRtmpPusherProtocol;
@class SellyLiveVideoConfiguration;
@class SellyLiveAudioConfiguration;
@class NSString;
SWIFT_CLASS("_TtC13SellyCloudSDK12HKRtmpPusher")
@interface HKRtmpPusher : NSObject
@property (nonatomic, strong) UIView * _Nullable preview;
@property (nonatomic) NSInteger reconnectInterval;
@property (nonatomic) NSInteger reconnectCount;
@property (nonatomic, strong) id <HKRtmpPusherProtocol> _Nullable delegate;
@property (nonatomic) enum AVCaptureDevicePosition currentPosition;
@property (nonatomic) BOOL muted;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
- (void)startRunning:(enum AVCaptureDevicePosition)captureDevicePosition videoConfig:(SellyLiveVideoConfiguration * _Nonnull)videoConfig audioConfig:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startRunningAudio:(SellyLiveAudioConfiguration * _Nonnull)audioConfig;
- (void)startLive:(NSString * _Nonnull)urlStr;
- (void)stopLive;
- (void)startCamera;
- (void)stopCamera;
- (void)switchCamera;
- (void)setPreviewView:(UIView * _Nonnull)view;
@end
@class SellyLivePusherStats;
SWIFT_PROTOCOL("_TtP13SellyCloudSDK20HKRtmpPusherProtocol_")
@protocol HKRtmpPusherProtocol
///
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onPushStatusChanged:(NSString * _Nonnull)status;
@optional
- (void)pusher:(HKRtmpPusher * _Nonnull)pusher onLiveStatsChanged:(SellyLivePusherStats * _Nonnull)stats;
@end
/// The <code>IOStream</code> class is the foundation of a RTMPStream.
SWIFT_CLASS("_TtC13SellyCloudSDK8IOStream")
@interface IOStream : NSObject
/// The number of frames per second being displayed.
@property (nonatomic, readonly) uint16_t currentFPS;
/// Creates an object.
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
@class NSCoder;
@protocol MTLDevice;
/// A view that displays a video content of a NetStream object which uses Metal api.
SWIFT_CLASS("_TtC13SellyCloudSDK8MTHKView")
@interface MTHKView : MTKView
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nonnull instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
- (void)drawRect:(CGRect)rect;
- (nonnull instancetype)initWithFrame:(CGRect)frameRect device:(id <MTLDevice> _Nullable)device SWIFT_UNAVAILABLE;
@end
/// The NetSocket class creates a two-way connection between a client and a server as a client. This class is wrapper for a InputStream and an OutputStream.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetSocket")
@interface NetSocket : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
/// The NetClient class creates a two-way connection between a NetService.
SWIFT_CLASS("_TtC13SellyCloudSDK9NetClient")
@interface NetClient : NetSocket
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
/// The NetService class creates a two-way connection between a client and a server as a server.
SWIFT_CLASS("_TtC13SellyCloudSDK10NetService")
@interface NetService : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
@class NSNetService;
@class NSInputStream;
@class NSOutputStream;
@interface NetService (SWIFT_EXTENSION(SellyCloudSDK)) <NSNetServiceDelegate>
- (void)netService:(NSNetService * _Nonnull)sender didAcceptConnectionWithInputStream:(NSInputStream * _Nonnull)inputStream outputStream:(NSOutputStream * _Nonnull)outputStream;
@end
@class NSStream;
@interface NetSocket (SWIFT_EXTENSION(SellyCloudSDK)) <NSStreamDelegate>
- (void)stream:(NSStream * _Nonnull)aStream handleEvent:(NSStreamEvent)eventCode;
@end
@class AVSampleBufferDisplayLayer;
/// A view that displays a video content of a NetStream object which uses AVSampleBufferDisplayLayer api.
SWIFT_CLASS("_TtC13SellyCloudSDK9PiPHKView")
@interface PiPHKView : UIView
/// Returns the class used to create the layer for instances of this class.
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layerClass;)
+ (Class _Nonnull)layerClass SWIFT_WARN_UNUSED_RESULT;
/// The views Core Animation layer used for rendering.
@property (nonatomic, readonly, strong) AVSampleBufferDisplayLayer * _Nonnull layer;
/// Initializes and returns a newly allocated view object with the specified frame rectangle.
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER;
/// Returns an object initialized from data in a given unarchiver.
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)aDecoder OBJC_DESIGNATED_INITIALIZER;
/// Prepares the receiver for service after it has been loaded from an Interface Builder archive, or nib file.
- (void)awakeFromNib;
@end
/// An object that provides the interface to control a one-way channel over a RtmpConnection.
SWIFT_CLASS("_TtC13SellyCloudSDK10RTMPStream")
@interface RTMPStream : IOStream
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
#endif // defined(__OBJC__)
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__cplusplus)
#endif
#pragma clang diagnostic pop
#endif
#else
#error unsupported Swift architecture
#endif

View File

@@ -0,0 +1,38 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "SellyCloudSDKError.h"
#import "SellyLiveAudioConfiguration.h"
#import "SellyLivePlayerDelegate.h"
#import "SellyLivePlayerStats.h"
#import "SellyLivePusherDelegate.h"
#import "SellyLivePusherStats.h"
#import "SellyLiveVideoConfiguration.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyLiveVideoPusher.h"
#import "SellyPlayerStreamInfo.h"
#import "SellyPublicDefinition.h"
#import "SellyRTCReplayKitHandler.h"
#import "SellyRTCSession.h"
#import "SellyRTCSessionDelegate.h"
#import "SellyRTCStats.h"
#import "SellyRtcVideoCanvas.h"
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCVideoFrame.h"
#import "SellyVodPlayerDelegate.h"
#import "SellyVodVideoPlayer.h"
#import "SellyCloudManager.h"
#import "LFLiveDebug.h"
FOUNDATION_EXPORT double SellyCloudSDKVersionNumber;
FOUNDATION_EXPORT const unsigned char SellyCloudSDKVersionString[];

View File

@@ -0,0 +1,170 @@
//
// SellyCloudSDKError.h
// SellyCloudSDK
//
// Created on 19/12/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark - Error Domain
/// SellyCloudSDK 错误域
FOUNDATION_EXPORT NSErrorDomain const SellyCloudSDKErrorDomain;
#pragma mark - Error Code Ranges
/*
错误代码范围规划:
1000-1999: 通用错误(参数校验、配置错误等)
2000-2999: 直播推流相关错误
3000-3999: 视频播放相关错误
4000-4999: 网络请求相关错误
5000-5999: 信令相关错误WebSocket、RTC信令
6000-6999: 音视频会议相关错误
7000-7999: 媒体设备相关错误
8000-8999: 编解码相关错误
9000-9999: 预留
*/
#pragma mark - Common Errors (1000-1999)
typedef NS_ENUM(NSInteger, SellyCloudSDKErrorCode) {
// MARK: - 通用错误 (1000-1999)
/// 通用错误(具体错误见描述)
SellyCloudSDKErrorCodeGeneral = 1000,
/// 参数为空
SellyCloudSDKErrorCodeEmptyParameter = 1001,
/// 配置错误
SellyCloudSDKErrorCodeInvalidConfiguration = 1002,
/// SDK 未初始化
SellyCloudSDKErrorCodeNotInitialized = 1003,
/// 操作不支持
SellyCloudSDKErrorCodeOperationNotSupported = 1004,
/// 重复操作
SellyCloudSDKErrorCodeDuplicateOperation = 1005,
// MARK: - 直播推流错误 (2000-2999)
/// URL/StreamID 不能为空
SellyCloudSDKErrorCodePushURLEmpty = 2000,
/// 预览窗口不能为空
SellyCloudSDKErrorCodePreviewEmpty = 2001,
/// 语音直播下无法开启相机
SellyCloudSDKErrorCodeCannotStartCameraInAudioMode = 2002,
/// 推流已经在运行
SellyCloudSDKErrorCodePushAlreadyRunning = 2003,
/// 推流未运行
SellyCloudSDKErrorCodePushNotRunning = 2004,
/// 推流连接失败
SellyCloudSDKErrorCodePushConnectionFailed = 2005,
/// 推流断开连接
SellyCloudSDKErrorCodePushDisconnected = 2006,
/// 推流超时
SellyCloudSDKErrorCodePushTimeout = 2007,
// MARK: - 视频播放错误 (3000-3999)
/// 播放 URL 为空
SellyCloudSDKErrorCodePlayURLEmpty = 3000,
/// 播放器初始化失败
SellyCloudSDKErrorCodePlayerInitFailed = 3001,
/// 播放失败
SellyCloudSDKErrorCodePlaybackFailed = 3002,
/// 播放超时
SellyCloudSDKErrorCodePlaybackTimeout = 3003,
// MARK: - 网络请求错误 (4000-4999)
/// AppKey/Name 未初始化
SellyCloudSDKErrorCodeAppKeyNotInitialized = 4000,
/// 网络请求失败
SellyCloudSDKErrorCodeNetworkRequestFailed = 4001,
/// 网络连接超时
SellyCloudSDKErrorCodeNetworkTimeout = 4002,
/// 服务器返回错误
SellyCloudSDKErrorCodeServerError = 4003,
/// 数据解析失败
SellyCloudSDKErrorCodeDataParseFailed = 4004,
// MARK: - 信令相关错误 (5000-5999)
/// WebSocket 连接失败
SellyCloudSDKErrorCodeWebSocketConnectionFailed = 5000,
/// WebSocket 断开连接
SellyCloudSDKErrorCodeWebSocketDisconnected = 5001,
/// 信令超时无响应
SellyCloudSDKErrorCodeSignalNoACK = 5002,
/// 信令消息为空
SellyCloudSDKErrorCodeSignalMessageEmpty = 5003,
/// 信令消息格式错误
SellyCloudSDKErrorCodeSignalMessageInvalid = 5004,
// MARK: - 音视频会议错误 (6000-6999)
/// RTC 连接失败
SellyCloudSDKErrorCodeRTCConnectionFailed = 6000,
/// RTC 会议创建失败
SellyCloudSDKErrorCodeRTCSessionCreateFailed = 6001,
/// RTC 对等连接失败
SellyCloudSDKErrorCodeRTCP2PConnectionFailed = 6002,
/// 加入房间失败
SellyCloudSDKErrorCodeJoinRoomFailed = 6003,
/// 离开房间失败
SellyCloudSDKErrorCodeLeaveRoomFailed = 6004,
// MARK: - 媒体设备错误 (7000-7999)
/// 相机权限被拒绝
SellyCloudSDKErrorCodeCameraPermissionDenied = 7000,
/// 麦克风权限被拒绝
SellyCloudSDKErrorCodeMicrophonePermissionDenied = 7001,
/// 相机不可用
SellyCloudSDKErrorCodeCameraUnavailable = 7002,
/// 麦克风不可用
SellyCloudSDKErrorCodeMicrophoneUnavailable = 7003,
/// 设备占用
SellyCloudSDKErrorCodeDeviceBusy = 7004,
// MARK: - 编解码错误 (8000-8999)
/// 编码器初始化失败
SellyCloudSDKErrorCodeEncoderInitFailed = 8000,
/// 解码器初始化失败
SellyCloudSDKErrorCodeDecoderInitFailed = 8001,
/// 编码失败
SellyCloudSDKErrorCodeEncodeFailed = 8002,
/// 解码失败
SellyCloudSDKErrorCodeDecodeFailed = 8003,
};
#pragma mark - Error UserInfo Keys
/// 错误的详细描述 key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorDescriptionKey;
/// 错误的恢复建议 key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorRecoverySuggestionKey;
/// 底层错误如系统错误、第三方库错误key
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorUnderlyingErrorKey;
/// 服务端原始错误码 key用于调试和日志记录
FOUNDATION_EXPORT NSErrorUserInfoKey const SellyCloudSDKErrorServerCodeKey;
#pragma mark - Error Creation Helper
/// 创建 SellyCloudSDK 错误的便捷方法
FOUNDATION_EXPORT NSError * SellyCloudSDKError(NSInteger code, NSString *description);
/// 创建带底层错误的 SellyCloudSDK 错误
FOUNDATION_EXPORT NSError * SellyCloudSDKErrorWithUnderlying(NSInteger code, NSString *description, NSError * _Nullable underlyingError);
/// 创建服务端错误(包含服务端原始错误码)
FOUNDATION_EXPORT NSError * SellyCloudSDKServerError(NSInteger serverCode, NSString *description);
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,73 @@
//
// SellyLiveAudioConfiguration.h
// SellyCloudLiveKit
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
/// 音频码率 (默认96Kbps)
typedef NS_ENUM (NSUInteger, SellyLiveAudioBitRate) {
/// 32Kbps 音频码率
SellyLiveAudioBitRate_32Kbps = 32000,
/// 64Kbps 音频码率
SellyLiveAudioBitRate_64Kbps = 64000,
/// 96Kbps 音频码率
SellyLiveAudioBitRate_96Kbps = 96000,
/// 128Kbps 音频码率
SellyLiveAudioBitRate_128Kbps = 128000,
/// 默认音频码率,默认为 96Kbps
SellyLiveAudioBitRate_Default = SellyLiveAudioBitRate_96Kbps
};
/// 音频采样率 (默认44.1KHz)
typedef NS_ENUM (NSUInteger, SellyLiveAudioSampleRate){
/// 16KHz 采样率
SellyLiveAudioSampleRate_16000Hz = 16000,
/// 44.1KHz 采样率
SellyLiveAudioSampleRate_44100Hz = 44100,
/// 48KHz 采样率
SellyLiveAudioSampleRate_48000Hz = 48000,
/// 默认音频采样率,默认为 44.1KHz
SellyLiveAudioSampleRate_Default = SellyLiveAudioSampleRate_44100Hz
};
/// Audio Live quality音频质量
typedef NS_ENUM (NSUInteger, SellyLiveAudioQuality){
/// 低音频质量 audio sample rate: 16KHz audio bitrate: numberOfChannels 1 : 32Kbps 2 : 64Kbps
SellyLiveAudioQuality_Low = 0,
/// 中音频质量 audio sample rate: 44.1KHz audio bitrate: 96Kbps
SellyLiveAudioQuality_Medium = 1,
/// 高音频质量 audio sample rate: 44.1MHz audio bitrate: 128Kbps
SellyLiveAudioQuality_High = 2,
/// 超高音频质量 audio sample rate: 48KHz, audio bitrate: 128Kbps
SellyLiveAudioQuality_VeryHigh = 3,
/// 默认音频质量 audio sample rate: 44.1KHz, audio bitrate: 96Kbps
SellyLiveAudioQuality_Default = SellyLiveAudioQuality_High
};
@interface SellyLiveAudioConfiguration : NSObject<NSCoding, NSCopying>
/// 默认音频配置
+ (instancetype)defaultConfiguration;
/// 音频配置
+ (instancetype)defaultConfigurationForQuality:(SellyLiveAudioQuality)audioQuality;
#pragma mark - Attribute
///=============================================================================
/// @name Attribute
///=============================================================================
/// 声道数目(default 2)
@property (nonatomic, assign) NSUInteger numberOfChannels;
/// 采样率
@property (nonatomic, assign) SellyLiveAudioSampleRate audioSampleRate;
/// 码率
@property (nonatomic, assign) SellyLiveAudioBitRate audioBitrate;
/// flv编码音频头 44100 为0x12 0x10
@property (nonatomic, assign, readonly) char *asc;
/// 缓存区长度
@property (nonatomic, assign,readonly) NSUInteger bufferLength;
@end

View File

@@ -0,0 +1,69 @@
//
// SellyPlayerDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 14/7/25.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
#import "SellyLiveVideoPlayer.h"
#import "SellyRTCVideoFrame.h"
#import "SellyLivePlayerStats.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SellyLivePlayerDelegate <NSObject>
@optional
/**
SellyCloudMPMovieFinishReason
*/
- (void)player:(SellyLiveVideoPlayer *)player playbackDidFinished:(NSDictionary *)resultInfo;
- (void)player:(SellyLiveVideoPlayer *)player playbackStateChanged:(SellyPlayerState)state;
/**
首帧视频完成加载
@param elapse 调用play到加载完成耗时ms
*/
- (void)player:(SellyLiveVideoPlayer *)player firstRemoteVideoFrame:(NSInteger)elapse;
/**
首帧音频完成加载
@param elapse 调用play到加载完成耗时ms
*/
- (void)player:(SellyLiveVideoPlayer *)player firstRemoteAudioFrame:(NSInteger)elapse;
/**
追帧开始
@param rate 追帧速率
*/
- (void)player:(SellyLiveVideoPlayer *)player onFrameCatchingStart:(CGFloat)rate;
/**
追帧结束
*/
- (void)playerDidEndFrameCatching:(SellyLiveVideoPlayer *)player;
- (void)player:(SellyLiveVideoPlayer *)player onError:(NSError *)error;
/**
视频帧渲染回调
@param player 播放器实例
@param videoFrame 视频帧数据
@return 是否继续处理该帧
* - YES: 不忽略该帧
* - NO: 忽略该帧,不会继续渲染
*/
- (BOOL)player:(SellyLiveVideoPlayer *)player onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame;
/**
播放器调试信息回调
@param player 播放器实例
@param stats 播放器统计信息,包含各种性能指标和调试数据
*/
- (void)player:(SellyLiveVideoPlayer *)player onDebugInfo:(SellyLivePlayerStats *)stats;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,51 @@
//
// SellyLivePlayerStats.h
// SellyCloudSDK
//
// Created by Caleb on 26/1/13.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyLivePlayerStats : NSObject <NSCopying>
/// 播放协议RTMP/HLS/WebRTC等
@property (nonatomic, strong) NSString *protocol;
/// App / System CPU%
@property (nonatomic, assign) NSUInteger appCpu;
@property (nonatomic, assign) NSUInteger systemCpu;
/// 视频帧率fps
@property (nonatomic, assign) NSInteger fps;
/// 视频 / 音频码率kbps
@property (nonatomic, assign) NSInteger videoBitrate;
@property (nonatomic, assign) NSInteger audioBitrate;
/// 总下行速率kbps等于 videoBitrate + audioBitrate
@property (nonatomic, assign) NSInteger netSpeed;
/// RTT - 往返时延ms
@property (nonatomic, assign) NSInteger rtt;
/// 视频分辨率
@property (nonatomic, assign) CGSize videoSize;
/// 快照时间ms since boot
@property (nonatomic, assign) uint64_t timestampMs;
/// 是否正在loading
@property (nonatomic, assign) BOOL isLoading;
/// 丢包率(%
@property (nonatomic, assign) CGFloat packetLossRate;
/// 卡顿时间ms- 统计周期内的累积卡顿时长
@property (nonatomic, assign) NSUInteger freezeTime;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,25 @@
//
// SellyCloudRTMPDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 7/7/25.
//
#import <Foundation/Foundation.h>
#import "LFLiveDebug.h"
#import "SellyPublicDefinition.h"
#import "SellyLivePusherStats.h"
NS_ASSUME_NONNULL_BEGIN
@class SellyLiveVideoPusher;
@protocol SellyLivePusherDelegate <NSObject>
@optional
- (void)pusher:(SellyLiveVideoPusher *)pusher liveStatusDidChanged:(SellyLiveState)status;
- (void)pusher:(SellyLiveVideoPusher *)pusher onError:(NSError *)error;
//视频前处理
- (CVPixelBufferRef)pusher:(SellyLiveVideoPusher *)pusher onCaptureVideoFrame:(CVPixelBufferRef)pixelBuffer;
//直播中stats回调
- (void)pusher:(SellyLiveVideoPusher *)pusher onStatisticsUpdate:(SellyLivePusherStats *)stats;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,47 @@
//
// SellyLivePusherStats.h
// AFNetworking
//
// Created by Caleb on 23/9/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyLivePusherStats : NSObject <NSCopying>
//直播协议
@property (nonatomic, strong)NSString *protocol;
/// App / System CPU%
@property (nonatomic, assign) NSUInteger appCpu;
@property (nonatomic, assign) NSUInteger systemCpu;
/// 帧率fps
@property (nonatomic, assign) NSUInteger fps;
/// 视频 / 音频码率kbps
@property (nonatomic, assign) NSUInteger videoBitrate;
@property (nonatomic, assign) NSUInteger audioBitrate;
/// 总上行速率kbps等于videoBitrate+audioBitrate
@property (nonatomic, assign) NSUInteger netSpeed;
/// RTTms
@property (nonatomic, assign) NSUInteger rtt;
/// 丢包率(%
@property (nonatomic, assign) CGFloat packetLossRate;
//卡顿时长
@property (nonatomic, assign) NSInteger freezeTime;
/// 快照时间ms since boot
@property (nonatomic, assign) uint64_t timestampMs;
//videoSize
@property (nonatomic, assign)CGSize size;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,42 @@
//
// SellyLiveVideoConfiguration.h
// SellyCloudLiveKit
//
// Created by LaiFeng on 16/5/20.
// Copyright © 2016年 LaiFeng All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
@interface SellyLiveVideoConfiguration : NSObject <NSCopying>
/// 默认视频配置
+ (instancetype)defaultConfiguration;
#pragma mark - Attribute
///=============================================================================
/// @name Attribute
///=============================================================================
/// 视频输出分辨率,宽高务必设定为 2 的倍数,否则解码播放时可能出现绿边
@property (nonatomic, assign) SellyRTCVideoResolution videoSize;
/// 视频输出方向
@property (nonatomic, assign) UIInterfaceOrientation outputImageOrientation;
/// 视频的帧率,即 fps
@property (nonatomic, assign) NSUInteger videoFrameRate;
/// 视频的最小帧率,即 fps
@property (nonatomic, assign) NSUInteger videoMinFrameRate;
/// 最大关键帧间隔,可设定为 fps 的2倍影响一个 gop 的大小
@property (nonatomic, assign) NSUInteger videoMaxKeyframeInterval;
/// 视频的码率,单位是 bps
@property (nonatomic, assign) NSUInteger videoBitRate;
/// 视频的最小码率,单位是 bps
@property (nonatomic, assign) NSUInteger videoMinBitRate;
@end

View File

@@ -0,0 +1,48 @@
//
// SellyVideoPlayer.h
// SellyCloudSDK
// 直播rtmp、rtc播放器
// Created by Caleb on 17/9/25.
//
#import <Foundation/Foundation.h>
#import "SellyPlayerStreamInfo.h"
@protocol SellyLivePlayerDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface SellyLiveVideoPlayer : NSObject
//接盾的情况下请调用该方法初始化
- (void)startPlayStreamInfo:(SellyPlayerStreamInfo *)streamInfo;
- (void)startPlayUrl:(NSString *)url;
- (void)resume;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
/** 截取当前图片 */
- (UIImage *)getCurrentImage;
/** 设置渲染视图(类似腾讯 V2TXLivePlayer 的 setRenderView:*/
- (void)setRenderView:(nullable UIView *)view;
//业务层需要传入用于显示的容器视图
@property (nonatomic, weak, readonly, nullable)UIView *renderView;
//代理
@property (nonatomic, weak) id<SellyLivePlayerDelegate> delegate;
//音量 静音播放设置0即可
@property (nonatomic, assign) CGFloat playbackVolume;
//播放状态
@property(nonatomic, readonly) SellyPlayerState playbackState;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//token
@property (nonatomic, strong)NSString *token;
/// XOR 解密密钥 (十六进制字符串, 如 @"ABCDEF12")
/// 必须为偶数长度且仅包含 0-9, a-f, A-F传入非法值将抛出 NSInvalidArgumentException 导致 App 崩溃。
/// 传 nil 或空字符串表示不解密。
@property (nonatomic, copy, nullable)NSString *xorKey;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,131 @@
//
// SellyVideoPusher.h
// SellyCloudSDK
//
// Created by Caleb on 18/9/25.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "SellyLivePusherDelegate.h"
#import "SellyPlayerStreamInfo.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyLiveVideoPusher : NSObject
/**
* 初始化直播推流器
*
* @param liveMode 推流协议类型RTMP/RTC 协议。
*/
- (instancetype)initWithLiveMode:(SellyLiveMode)liveMode NS_DESIGNATED_INITIALIZER;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
/**
是否开启本地预览镜像
*/
@property (nonatomic, assign)BOOL mirror;
/**
开始采集音视频流程,默认会采集语音和视频
@param captureDevicePosition 使用前置还是后置摄像头
@param videoConfig 视频采集/推流参数传nil将使用默认推流参数
@param audioConfig 音频采集/推流参数传nil将使用默认推流参数
*/
- (void)startRunning:(AVCaptureDevicePosition)captureDevicePosition videoConfig:(nullable SellyLiveVideoConfiguration *)videoConfig audioConfig:(nullable SellyLiveAudioConfiguration *)audioConfig;
/**
纯语音直播调用该方法,开始采集语音流程,不会采集视频
无法在直播中开启视频需要开关摄像头的请调用startRunning:videoConfig:audioConfig:方法
@param audioConfig 音频采集/推流参数传nil将使用默认推流参数
*/
- (void)startRunningAudio:(nullable SellyLiveAudioConfiguration *)audioConfig;
/**
开启视频采集,中途关闭摄像头再次开启需要调用
*/
- (nullable NSError *)startCamera;
/**
停止视频采集,中途关闭摄像头调用
*/
- (void)stopCamera;
/**
切换前后摄像头
*/
- (void)switchCameraPosition:(void (^)(NSError * _Nullable error))completion;
/**
开启音频采集
*/
- (void)startMicrophone;
/**
停止语音采集
*/
- (void)stopMicrophone;
/**
开始推流
@return 返回nil表示流程成功不代表推流成功
@param url 推流地址
*/
- (nullable NSError *)startLiveWithUrl:(NSString *)url;
- (nullable NSError *)startLiveWithStreamId:(NSString *)streamId;
/**
停止推流
*/
- (void)stopLive:(void(^)(NSError *error))callback;
/**
截取当前图片
*/
- (UIImage *)getCurrentImage;
/**
推送静态图片调用1次即可不用循环调用
*/
- (void)pushStaticImage:(UIImage *)image;
/**
停止推送静态图片
*/
- (void)stopPushImage;
/**
本地预览view
*/
@property (nonatomic, strong)UIView *preview;
/**
回调
*/
@property (nonatomic, weak)id<SellyLivePusherDelegate> delegate;
@property (nonatomic, assign, readonly)BOOL isMute;
@property (nonatomic, assign, readonly)BOOL isCameraEnable;
@property (nonatomic, assign, readonly)SellyLiveState liveState;
/**
是否支持视频前置处理,例如实现美颜功能. default no
*/
@property (nonatomic, assign)BOOL enableCustomVideoProcess;
//当前的摄像头方向
@property (nonatomic, assign)AVCaptureDevicePosition captureDevicePosition;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//videoConfig
@property (nonatomic, assign)SellyLiveVideoConfiguration *videoConfig;
//token
@property (nonatomic, strong)NSString *token;
/// XOR 加密密钥 (十六进制字符串, 如 @"ABCDEF12")
/// 必须为偶数长度且仅包含 0-9, a-f, A-F传入非法值将抛出 NSInvalidArgumentException 导致 App 崩溃。
/// 传 nil 或空字符串表示不加密。
@property (nonatomic, copy, nullable)NSString *xorKey;
/// 是否启用 Center Stage人物居中默认 NO
/// 支持运行时动态切换,不支持的设备设置无效
@property (nonatomic, assign) BOOL centerStageEnabled;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,18 @@
//
// SellyPlayerStreamInfo.h
// SellyCloudSDK
//
// Created by Caleb on 18/9/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyPlayerStreamInfo : NSObject
@property (nonatomic, strong)NSString *streamId;
//rtmp,rtc
@property (nonatomic, assign)SellyLiveMode protocol;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,98 @@
//
// SellyPublicDefinition.h
// Pods
//
// Created by Caleb on 22/8/25.
//
#ifndef SellyPublicDefinition_h
#define SellyPublicDefinition_h
//视频输出分辨率
typedef CGSize SellyRTCVideoResolution;
extern SellyRTCVideoResolution const SellyRTCVideoResolution480x360;
extern SellyRTCVideoResolution const SellyRTCVideoResolution480x480;
extern SellyRTCVideoResolution const SellyRTCVideoResolution640x360;
extern SellyRTCVideoResolution const SellyRTCVideoResolution640x480;
extern SellyRTCVideoResolution const SellyRTCVideoResolution960x540;
extern SellyRTCVideoResolution const SellyRTCVideoResolution1280x720;
typedef NS_ENUM(NSInteger, SellyVideoCodecType) {
SellyVideoCodecTypeH264 = 1,
SellyVideoCodecTypeH265 = 2,
};
/**
* 支持协议
*/
typedef NS_ENUM(NSUInteger, SellyLiveMode) {
/// 支持协议: RTMP。
SellyLiveMode_RTMP,
/// 支持协议: TRTC。
SellyLiveMode_RTC
};
typedef NS_ENUM(NSInteger, SellyPlayerScalingMode) {
SellyPlayerScalingModeNone, // No scaling
SellyPlayerScalingModeAspectFit, // Uniform scale until one dimension fits
SellyPlayerScalingModeAspectFill, // Uniform scale until the movie fills the visible bounds. One dimension may have clipped contents
};
typedef NS_ENUM(NSInteger, SellyPlayerState) {
SellyPlayerStateIdle = 0,
SellyPlayerStateConnecting = 1,
SellyPlayerStatePlaying = 2,
SellyPlayerStatePaused = 3,
SellyPlayerStateStoppedOrEnded = 4,
SellyPlayerStateFailed = 5
};
typedef NS_ENUM(NSInteger, SellyCloudMPMovieFinishReason) {
SellyCloudMPMovieFinishReasonPlaybackEnded,
SellyCloudMPMovieFinishReasonPlaybackError,
SellyCloudMPMovieFinishReasonUserExited
};
typedef NS_ENUM(NSInteger, SellyLiveState) {
SellyLiveStateIdle = 0, // 初始/未开始
SellyLiveStateConnecting, // 建立会话RTMP连接 或 SDP/ICE协商中
SellyLiveStatePublishing, // 已在上行推流(码流稳定输出)
SellyLiveStateReconnecting, // 断线重试中(短暂)
SellyLiveStateStopped, // 正常结束stop
SellyLiveStateFailed // 异常结束(错误/不可恢复)
};
typedef NS_ENUM (NSUInteger, SellyCloudLiveSocketErrorCode) {
SellyCloudLiveSocketError_PreView = 201, ///< 预览失败
SellyCloudLiveSocketError_GetStreamInfo = 202, ///< 获取流媒体信息失败
SellyCloudLiveSocketError_ConnectSocket = 203, ///< 连接socket失败
SellyCloudLiveSocketError_Verification = 204, ///< 验证服务器失败
SellyCloudLiveSocketError_ReConnectTimeOut = 205, ///< 重新连接服务器超时
SellyCloudLiveSocketError_HttpRequest = 400, //http请求报错
};
typedef NS_ENUM(NSInteger, SellyVideoCallType) {
SellyVideoCallTypeAudio, // 语音
SellyVideoCallTypeVideo, // 视频
};
//信令连接状态
typedef NS_ENUM(NSInteger, SellyRoomConnectionState) {
SellyRoomStateDisconnected,
SellyRoomStateConnecting,
SellyRoomStateConnected,
SellyRoomStateReconnecting,
SellyRoomStateFailed,
};
//屏幕分享状态
typedef NS_ENUM(uint8_t, SellyScreenShareState) {
SellyScreenShareStateStarted = 1, // 开始
SellyScreenShareStatePaused = 2, // 暂停
SellyScreenShareStateResumed = 3, // 恢复
SellyScreenShareStateStopped = 4, // 结束
};
#endif /* SellyPublicDefinition_h */

View File

@@ -0,0 +1,17 @@
//
// SellyRTCReplayKitHandler.h
// SellyCloudSDK
//
// Created by Caleb on 12/10/25.
//
#import <Foundation/Foundation.h>
#import <ReplayKit/ReplayKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCReplayKitHandler : RPBroadcastSampleHandler
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,99 @@
//
// SellyRTCSession.h
// SellyCloudSDK
//
// Created by Caleb on 17/11/25.
//
#import <Foundation/Foundation.h>
#import "SellyRTCVideoConfiguration.h"
#import "SellyRTCSessionDelegate.h"
#import <AVFoundation/AVFoundation.h>
#import "SellyRTCVideoCanvas.h"
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCSession : NSObject
/**
@param isP2p 是否单聊
*/
- (instancetype)initWithType:(BOOL)isP2p;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
/**
@brief 发起通话
*/
- (void)startWithChannelId:(NSString *)channelId token:(NSString *)token;
/// 结束通话
- (void)end;
//是否开启本地视频,默认不开启
- (void)enableLocalVideo:(BOOL)enable;
//是否开启本地音频采集,默认开启
- (void)enableLocalAudio:(BOOL)enable;
//切换前后摄像头
- (void)switchCamera;
/**
* Starts the local video preview before joining a channel.
*
* Once you call this method to start the local video preview, if you leave
* the channel by calling \ref leaveChannel: leaveChannel, the local video
* preview remains until you call \ref stopPreview to disable it.
*/
- (void)startPreview;
/**
* Stops the local video preview and the video.
*/
- (void)stopPreview;
/**
屏蔽对方的声音单聊不用传userId
*/
- (void)muteRemoteAudioStream:(NSString *)userId mute:(BOOL)mute;
/**
@brief 设置声音输出通道
如果没有外接设备(蓝牙,耳机)等,可以直接调用这个方法在听筒和扬声器直接来回切换
如果有外接设备建议直接使用AVRoutePickerView
有外接设备的情况下,无法切换为听筒播放,但是可以切换为扬声器播放
*/
- (void)setAudioOutput:(AVAudioSessionPortOverride)port;
/**
发送自定义消息给对方
*/
- (void)sendMessage:(NSString *)message completion:(nonnull void (^)(NSError * _Nullable))completion;
//本地localView
- (void)setLocalCanvas:(SellyRTCVideoCanvas *)localCanvas;
//远程remoteView
- (void)setRemoteCanvas:(SellyRTCVideoCanvas *)remoteCanvas;
//更新token
- (void)renewToken:(NSString * _Nonnull)token;
//Starts screen sharing.
- (void)startScreenCapture;
//外部推流不使用sdk默认的视频采集
- (void)pushExternalVideoFrame:(CVPixelBufferRef)pixelBuffer;
//
@property (nonatomic, weak)id<SellyRTCSessionDelegate> delegate;
//视频编码设置 需要在startWithChannelId之前调用
@property (nonatomic, strong)SellyRTCVideoConfiguration *videoConfig;
////通话连接状态
@property (nonatomic, assign, readonly)SellyRoomConnectionState connectionState;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,124 @@
//
// SellyRTCSessionDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 5/11/25.
//
#import <Foundation/Foundation.h>
#import "SellyRTCStats.h"
#import "SellyRTCVideoFrame.h"
@class SellyRTCSession;
NS_ASSUME_NONNULL_BEGIN
//流的连接状态
typedef enum : NSUInteger {
SellyRTCConnectStateDisconnected, //断开连接
SellyRTCConnectStateConnecting, //连接中
SellyRTCConnectStateConnected, //连接成功
SellyRTCConnectStateReconnecting, //重连
} SellyRTCConnectState;
@protocol SellyRTCSessionDelegate <NSObject>
@optional
/**
通话报错无法恢复,需要结束流程
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onError:(NSError *)error;
/** A remote user's video was enabled or disabled.
@param enabled Enabled or disabled:
* Yes: User has enabled the video function.
* No: User has disabled the video function.
@param userId Remote user ID.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session videoEnabled:(BOOL)enabled userId:(nullable NSString *)userId;
/** A remote user's audio was enabled or disabled.
@param enabled Enabled or disabled:
* Yes: User has enabled the audio function.
* No: User has disabled the audio function.
@param userId Remote user ID.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session audioEnabled:(BOOL)enabled userId:(nullable NSString *)userId;
/**
收到对方自定义消息
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session didReceiveMessage:(NSString *)message userId:(nullable NSString *)userId;
/**
@brief stream连接状态发生改变
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session connectionStateChanged:(SellyRTCConnectState)state userId:(nullable NSString *)userId;
/**
@brief 会话连接状态发生改变
会话重连期间内ice会持续重启直到超时
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onRoomConnectionStateChanged:(SellyRoomConnectionState)state;
//视频前处理
- (CVPixelBufferRef)rtcSession:(SellyRTCSession * _Nonnull)session onCaptureVideoFrame:(CVPixelBufferRef)pixelBuffer;
/**
* Occurs each time the SDK receives a video frame sent by the remote user.
*
* After you successfully register the video frame observer, the SDK triggers this callback each time a
* video frame is received. In this callback, you can get the video data sent by the remote user. You
* can then post-process the data according to your scenarios.
*
@return Determines whether to ignore the current video frame if the pre-processing fails:
* - true: Do not ignore.
* - false: Ignore, in which case this method does not sent the current video frame to the SDK.
*/
- (BOOL)rtcSession:(SellyRTCSession *)session onRenderVideoFrame:(SellyRTCVideoFrame *)videoFrame userId:(NSString *)userId;
/**
统计功能
如果是单聊 userId = nil
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onStats:(SellyRTCStats *)stats userId:(nullable NSString *)userId;
/**
用户加入频道
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onUserJoined:(nullable NSString *)userId;
/**
用户离开频道
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onUserLeave:(nullable NSString *)userId;
/**
通话时长回调
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onDuration:(NSInteger)duration;
/**
收到token将要过期消息
@param token The token that will expire in 60 seconds.
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session tokenWillExpire:(NSString *)token;
/**
收到token已过期消息
token过期后依然可以正常通话但是断网重连会失败
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session tokenExpired:(NSString *)token;
/**
屏幕分享状态发生变化
*/
- (void)rtcSession:(SellyRTCSession * _Nonnull)session onScreenShareStatusChanged:(SellyScreenShareState)state;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,49 @@
//
// SellyRTCP2pStats.h
// SellyCloudSDK
//
// Created by Caleb on 10/11/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCStats : NSObject
/// 基本
/// 传输ICE/DTLS
@property(nonatomic, assign) double transportRttMs; // candidate-pair.currentRoundTripTime * 1000
@property(nonatomic, copy, nullable) NSString *relayProtocol; // udp/tcp/tlsTURN时可见
@property(nonatomic, copy) NSString *audioCodec;
@property(nonatomic, copy) NSString *videoCodec;
/// 媒体累计字节
@property(nonatomic, assign) uint64_t txAudioBytes;
@property(nonatomic, assign) uint64_t txVideoBytes;
@property(nonatomic, assign) uint64_t rxAudioBytes;
@property(nonatomic, assign) uint64_t rxVideoBytes;
@property(nonatomic, assign, readonly) uint64_t txBytes; // 汇总
@property(nonatomic, assign, readonly) uint64_t rxBytes;
/// 视频信息(能拿到就填)
@property(nonatomic, assign) double sentFps;
@property(nonatomic, assign) NSInteger sentWidth;
@property(nonatomic, assign) NSInteger sentHeight;
@property(nonatomic, assign) double recvFps;
@property(nonatomic, assign) NSInteger recvWidth;
@property(nonatomic, assign) NSInteger recvHeight;
/// —— 新增:瞬时 Kbps由 Helper 用“前一帧”差分计算)——
@property(nonatomic, assign) double txAudioKbps; // 本次 - 上次 bytes / Δt
@property(nonatomic, assign) double txVideoKbps;
@property(nonatomic, assign) double rxAudioKbps;
@property(nonatomic, assign) double rxVideoKbps;
@property(nonatomic, assign) double txKbps; // = txAudioKbps + txVideoKbps
@property(nonatomic, assign) double rxKbps; // = rxAudioKbps + rxVideoKbps
/// 时间戳(内部用)
@property(nonatomic, assign) NSTimeInterval intervalMs; // 与上次快照的间隔(毫秒),首帧为 0
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// SellyRTCVideoConfiguration.h
// SellyCloudSDK
//
// Created by Caleb on 5/11/25.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoConfiguration : NSObject
//分辨率
@property(assign, nonatomic) SellyRTCVideoResolution resolution;
//帧率
@property(assign, nonatomic) NSInteger frameRate;
//最大码率 bps
@property(assign, nonatomic) NSInteger maxBitrate;
//最小码率 bps
@property(assign, nonatomic) NSInteger minBitrate;
/**
会议模式仅支持h264单聊支持h264h265
*/
@property (nonatomic, assign) SellyVideoCodecType preferCodec;
//默认使用前/后置摄像头
@property (nonatomic, assign)AVCaptureDevicePosition preferPosition;
+ (instancetype)defaultConfig;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// SCSVideoFrame.h
// SellyCloudSDK
//
// Created by Caleb on 19/11/25.
//
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoFrame : NSObject
/// 宽度(像素)
@property (nonatomic, assign) int width;
/// 高度(像素)
@property (nonatomic, assign) int height;
/// 旋转角度0 / 90 / 180 / 270
@property (nonatomic, assign) NSInteger rotation;
/// 时间戳(可选)
@property (nonatomic, assign) int64_t timestamp;
/// 像素数据
@property (nonatomic, assign, nullable) CVPixelBufferRef pixelBuffer;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// SellyRtcVideoCanvas.h
// SellyCloudSDK
//
// Created by Caleb on 11/11/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface SellyRTCVideoCanvas : NSObject
//用户id
@property(strong, nonatomic) NSString *userId;
/**
*The video display view.
*/
@property(strong, nonatomic) UIView *_Nullable view;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,69 @@
//
// SellyVodVideoPlayerDelegate.h
// SellyCloudSDK
//
// Created by Caleb on 07/1/26.
//
#import <Foundation/Foundation.h>
#import "SellyPublicDefinition.h"
#import "SellyVodVideoPlayer.h"
NS_ASSUME_NONNULL_BEGIN
@protocol SellyVodPlayerDelegate <NSObject>
@optional
- (void)player:(SellyVodVideoPlayer *)player prepareToPlayChanged:(BOOL)prepare;
/**
播放完成回调
@param resultInfo 包含完成原因SellyCloudMPMovieFinishReason等信息的字典
*/
- (void)player:(SellyVodVideoPlayer *)player playbackDidFinished:(NSDictionary *)resultInfo;
/**
播放状态变化回调
状态流转Idle → Connecting → Playing → Paused/Stopped/Failed
@param state 当前播放状态SellyPlayerState
*/
- (void)player:(SellyVodVideoPlayer *)player playbackStateChanged:(SellyPlayerState)state;
/**
首帧视频完成加载
@param elapse 调用 play 到首帧渲染完成的耗时(毫秒)
*/
- (void)player:(SellyVodVideoPlayer *)player firstRemoteVideoFrame:(NSInteger)elapse;
/**
首帧音频完成加载
@param elapse 调用 play 到首帧音频播放的耗时(毫秒)
*/
- (void)player:(SellyVodVideoPlayer *)player firstRemoteAudioFrame:(NSInteger)elapse;
/**
播放进度更新回调每秒触发一次适合更新UI进度条
注意:
- 如果需要总时长,请访问 player.duration 属性(一次性获取即可)
- 如果你只需要偶尔获取进度,建议直接读取 player.currentPlaybackTime 属性,避免不必要的回调
@param currentTime 当前播放时间(秒)
*/
- (void)player:(SellyVodVideoPlayer *)player playbackProgressChanged:(NSTimeInterval)currentTime;
/**
缓冲进度更新回调(当缓冲区发生变化时触发)
注意:
- 如果需要总时长,请访问 player.duration 属性(一次性获取即可)
- 如果你只需要偶尔获取缓冲进度,建议直接读取 player.playableDuration 属性
@param playableDuration 已缓冲的可播放时长(秒)
*/
- (void)player:(SellyVodVideoPlayer *)player bufferProgressChanged:(NSTimeInterval)playableDuration;
/**
错误回调
@param error 错误信息
*/
- (void)player:(SellyVodVideoPlayer *)player onError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,58 @@
//
// SellyVodVideoPlayer.h
// SellyCloudSDK
// 点播播放器
// Created by Caleb on 1/7/26.
//
#import <Foundation/Foundation.h>
@protocol SellyVodPlayerDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface SellyVodVideoPlayer : NSObject
/**
点播开始播放视频
@param url 播放地址,支持以下格式:
- 网络地址http(s)://xxx.mp4
- 本地文件路径:/var/mobile/.../video.mp4
- 本地文件URLfile:///var/mobile/.../video.mp4
*/
- (void)startPlayUrl:(NSString *)url;
- (void)resume;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
/** 截取当前图片 */
- (UIImage *)getCurrentImage;
/** 设置渲染视图*/
- (void)setRenderView:(nullable UIView *)view;
//业务层需要传入用于显示的容器视图
@property (nonatomic, weak, readonly, nullable)UIView *renderView;
//代理
@property (nonatomic, weak) id<SellyVodPlayerDelegate> delegate;
//音量 静音播放设置0即可
@property (nonatomic, assign) CGFloat playbackVolume;
//播放状态
@property(nonatomic, readonly) SellyPlayerState playbackState;
//缩放
@property (nonatomic, assign)SellyPlayerScalingMode scaleMode;
//是否自动开始播放默认true
@property(nonatomic) BOOL shouldAutoplay;
//视频时长
@property(nonatomic, readonly) NSTimeInterval duration;
//可播放时长
@property(nonatomic, readonly) NSTimeInterval playableDuration;
//当前播放进度
@property(nonatomic) NSTimeInterval currentPlaybackTime;
@property(nonatomic, readonly) BOOL isPreparedToPlay;
//播放速率
@property(nonatomic) float playbackRate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,10 @@
framework module SellyCloudSDK {
umbrella header "SellyCloudSDK-umbrella.h"
export *
module * { export * }
}
module SellyCloudSDK.Swift {
header "SellyCloudSDK-Swift.h"
}

View File

@@ -0,0 +1,509 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/LFLiveDebug.h</key>
<data>
n4VllQ2oCVCU0fgWxZpu3LHLBcc=
</data>
<key>Headers/SellyCloudManager.h</key>
<data>
NzsWvDX+W1XT5Y8q7VW5rZiHjNo=
</data>
<key>Headers/SellyCloudSDK-Swift.h</key>
<data>
8ouDcnOAaKwL+U7HIQLpJ6IupeI=
</data>
<key>Headers/SellyCloudSDK-umbrella.h</key>
<data>
bCyZ65oHyDvR8j0fy+WTx/+vz+0=
</data>
<key>Headers/SellyCloudSDKError.h</key>
<data>
LLeGh8wUSbwjDIYjEvGafLzxUHU=
</data>
<key>Headers/SellyLiveAudioConfiguration.h</key>
<data>
hyBzFpLp5uFb+QLbAKMFwPGXbTI=
</data>
<key>Headers/SellyLivePlayerDelegate.h</key>
<data>
WfLsf21F+crLU2bFWBVmcaxjP/8=
</data>
<key>Headers/SellyLivePlayerStats.h</key>
<data>
s5qPQJ1BEEQvZzJlnFaU50eeg4M=
</data>
<key>Headers/SellyLivePusherDelegate.h</key>
<data>
AUuhks5FbxUSUQD66fIfv41fTwI=
</data>
<key>Headers/SellyLivePusherStats.h</key>
<data>
Sv8qaR+2dFJ0RkmyW/FOugbyo7A=
</data>
<key>Headers/SellyLiveVideoConfiguration.h</key>
<data>
NaANC9bN9JYk4FIXfD5WBDqxXl8=
</data>
<key>Headers/SellyLiveVideoPlayer.h</key>
<data>
isZtcqZmuZaX9nKgROI8OnmzYkU=
</data>
<key>Headers/SellyLiveVideoPusher.h</key>
<data>
uks3J7iEIcCLQKWhFXo+62FogAk=
</data>
<key>Headers/SellyPlayerStreamInfo.h</key>
<data>
9z0gb0JGpCy3pPGXzij1gf2P1/0=
</data>
<key>Headers/SellyPublicDefinition.h</key>
<data>
0uftSU4knu+NYGldNj1zd/kwQ7s=
</data>
<key>Headers/SellyRTCReplayKitHandler.h</key>
<data>
fDiEcxTg1dZyKZAW6+BM1Db/i/c=
</data>
<key>Headers/SellyRTCSession.h</key>
<data>
YV99l4sENCaywBkvqkiNk/cEoJs=
</data>
<key>Headers/SellyRTCSessionDelegate.h</key>
<data>
nxC9SdtJv154D1m7UQ1gHiXPysk=
</data>
<key>Headers/SellyRTCStats.h</key>
<data>
ntWj5QSjIL94ENeF1ygCRJhvqZw=
</data>
<key>Headers/SellyRTCVideoConfiguration.h</key>
<data>
oQCvzX2XMHV20sWxiVG7M2qXx7Q=
</data>
<key>Headers/SellyRTCVideoFrame.h</key>
<data>
1pHWg6GxzCzK0NmFP0xnQGgmBGI=
</data>
<key>Headers/SellyRtcVideoCanvas.h</key>
<data>
ieDRoRBeMIpkZh8u35Nywc/jKws=
</data>
<key>Headers/SellyVodPlayerDelegate.h</key>
<data>
2xJwu/OvqhAbHf1D4RiVt9FRLow=
</data>
<key>Headers/SellyVodVideoPlayer.h</key>
<data>
AeZ6EXXKcGLBu9RQHtNtdCXPcSs=
</data>
<key>Info.plist</key>
<data>
2dWhPoxwZhcWArWRLGHZVPNlwNY=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
<data>
qseNQfuQMgFxIU6wa3bdh5ghark=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
<data>
XXHJeZhNHmj8dDtnDJT+hibSM54=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
<data>
a4nzUdeP9jQ0Er97OU5Xs+iU7Dg=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
<data>
XXHJeZhNHmj8dDtnDJT+hibSM54=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
<data>
+R3ymxFVzQAwfOOBCy3IZEj5VNs=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
<data>
qseNQfuQMgFxIU6wa3bdh5ghark=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
<data>
WGTzz1K/7TEnpCEOQDryaamTU8o=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
<data>
vXIz/2ahRlZGn0Hnt5RoEXksHM8=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
<data>
WGTzz1K/7TEnpCEOQDryaamTU8o=
</data>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
<data>
ALuv5pniVIkV/tdpVf1JFXCQY7o=
</data>
<key>Modules/module.modulemap</key>
<data>
QDzF9gcIS4C8LE5KBqHE5D/wGTk=
</data>
<key>SellyCloudSDK.bundle/Info.plist</key>
<data>
MaHS7sft9qCdScbxOphx0/Y4cxk=
</data>
<key>SellyCloudSDK.bundle/black.jpg</key>
<data>
N4Hjfo3wl+OzCBvq5YjjRDs96TA=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/LFLiveDebug.h</key>
<dict>
<key>hash2</key>
<data>
lnXImjQWbWnpLgyXsRbRKmDK2aNKhq+TxdhHdGh2zVI=
</data>
</dict>
<key>Headers/SellyCloudManager.h</key>
<dict>
<key>hash2</key>
<data>
I5TxcsKrZHS84PoNPCaptys6XFQXTu3lykZuR0+kfSc=
</data>
</dict>
<key>Headers/SellyCloudSDK-Swift.h</key>
<dict>
<key>hash2</key>
<data>
2wlrBDTTuVpIh4JaU/FaW3bMR6GDPoWnptTZnOuujsY=
</data>
</dict>
<key>Headers/SellyCloudSDK-umbrella.h</key>
<dict>
<key>hash2</key>
<data>
OHAh8VUZ87WP5e8Sd/UzpsrUaEpj5pnEbYntoe6ssfY=
</data>
</dict>
<key>Headers/SellyCloudSDKError.h</key>
<dict>
<key>hash2</key>
<data>
S3Caeif51LZApG/AxFDQtST2s6k5QoNpHrJylAsNcbQ=
</data>
</dict>
<key>Headers/SellyLiveAudioConfiguration.h</key>
<dict>
<key>hash2</key>
<data>
3LfwFX/V+xkKGQz0d2Tn4LeN1IInUDeZSOFlBKB7I5g=
</data>
</dict>
<key>Headers/SellyLivePlayerDelegate.h</key>
<dict>
<key>hash2</key>
<data>
3VsIgCyclQVF0hmj7g3MIdal1YvCgOfquhcDBuUr2PA=
</data>
</dict>
<key>Headers/SellyLivePlayerStats.h</key>
<dict>
<key>hash2</key>
<data>
czl/W+kDTBGcYaXQ8dTN5vceBeVCxtjQy1z4UIkn3ow=
</data>
</dict>
<key>Headers/SellyLivePusherDelegate.h</key>
<dict>
<key>hash2</key>
<data>
yU76azcwt6zEcSXM5yGsnGXW3LjKGwAeo+GybC3V4DU=
</data>
</dict>
<key>Headers/SellyLivePusherStats.h</key>
<dict>
<key>hash2</key>
<data>
p57pU/7pjLv7fPBp4o+CE3ctPL3kKkETQxAsGWYHqM0=
</data>
</dict>
<key>Headers/SellyLiveVideoConfiguration.h</key>
<dict>
<key>hash2</key>
<data>
CgDyBwX2OdY+mfwY2xk8MPr7NExJKz20KAMB/0v/76g=
</data>
</dict>
<key>Headers/SellyLiveVideoPlayer.h</key>
<dict>
<key>hash2</key>
<data>
1UALSPYyzpt2cskREMf9+sDu7PD47YaxATLQh+m8K9w=
</data>
</dict>
<key>Headers/SellyLiveVideoPusher.h</key>
<dict>
<key>hash2</key>
<data>
3NQOVilAviIQlKTvYTuBpCJiIGw0IV02Fd7Cc0pPOJU=
</data>
</dict>
<key>Headers/SellyPlayerStreamInfo.h</key>
<dict>
<key>hash2</key>
<data>
9Ik4Rn+atokSrnSDGZsL8ggkyV5+EGTu2Oua0wOEiBk=
</data>
</dict>
<key>Headers/SellyPublicDefinition.h</key>
<dict>
<key>hash2</key>
<data>
TP4UnTsMSSg3Aix8mekRkOrK8LLNNgTrx3aXhmY4+s8=
</data>
</dict>
<key>Headers/SellyRTCReplayKitHandler.h</key>
<dict>
<key>hash2</key>
<data>
AtMFsn9FCUGjNfoYvbbNovbvmdLMexJNGsCj6zURJ4g=
</data>
</dict>
<key>Headers/SellyRTCSession.h</key>
<dict>
<key>hash2</key>
<data>
L1L3IPP2GRRNdT0JQAyHG7Srf9+667HlZ6J8zRPlaEU=
</data>
</dict>
<key>Headers/SellyRTCSessionDelegate.h</key>
<dict>
<key>hash2</key>
<data>
sjjMuPeE2xrPuQgq8HhUSo+w5wsmOlgBpLO3DH+Y+o0=
</data>
</dict>
<key>Headers/SellyRTCStats.h</key>
<dict>
<key>hash2</key>
<data>
NZ2uhcD3ArK42TfB6aQL+hFG1NNSNxRX3aHOLcy+EjY=
</data>
</dict>
<key>Headers/SellyRTCVideoConfiguration.h</key>
<dict>
<key>hash2</key>
<data>
u1O+U+62iqbRdynTUWDVo+X4bgPWca7ozPOlMM7E/8g=
</data>
</dict>
<key>Headers/SellyRTCVideoFrame.h</key>
<dict>
<key>hash2</key>
<data>
BIJvSucE+8+QSmEFT77etU+nC5msdVWxJw1pM+WsDww=
</data>
</dict>
<key>Headers/SellyRtcVideoCanvas.h</key>
<dict>
<key>hash2</key>
<data>
/L+nK7RtmMhaJJFrZ4db2v9cTYBG35qANiozxWnMOuo=
</data>
</dict>
<key>Headers/SellyVodPlayerDelegate.h</key>
<dict>
<key>hash2</key>
<data>
gTWNdWZMwUfypeFDLMU1lTxOLcUSfaBHbHnsXp6qC5I=
</data>
</dict>
<key>Headers/SellyVodVideoPlayer.h</key>
<dict>
<key>hash2</key>
<data>
vlZrOUVjg0gWfrjAQ5noWPHybPBOi+xuiXKlpX4hSoE=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
<dict>
<key>hash2</key>
<data>
SzWmrfD5SCYOMYbk+UqEwqJ0KlW1Ol5QvWVCWCbWdY4=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
oPhczVik5MfFAsQpmnY4qA7FJERwc6UJyA2zke9CZYU=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
<dict>
<key>hash2</key>
<data>
VH/FP1w4H+8dTuhz8jvdl8zF1jE9W+QNeKO+FgNsCio=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
oPhczVik5MfFAsQpmnY4qA7FJERwc6UJyA2zke9CZYU=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
<dict>
<key>hash2</key>
<data>
iFK4nCGwtXqZujq/P101bAUZy+fuvATi30AoCA3azkE=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
<dict>
<key>hash2</key>
<data>
SzWmrfD5SCYOMYbk+UqEwqJ0KlW1Ol5QvWVCWCbWdY4=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
QRzQsRKowbF8zBEAWLWmpt4RChdz7Xwb9DCPlQBVmeE=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
<dict>
<key>hash2</key>
<data>
qL7Nvz2/Cgdf3dyyx4vEtsmRcu7lw3YAm3eNF5peYmk=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
<dict>
<key>hash2</key>
<data>
QRzQsRKowbF8zBEAWLWmpt4RChdz7Xwb9DCPlQBVmeE=
</data>
</dict>
<key>Modules/SellyCloudSDK.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
<dict>
<key>hash2</key>
<data>
fz24HOCFoL7WJXD8/yGu2gNPFI4twodzwP5X6RY2IPM=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash2</key>
<data>
FO57EBZH3fRf9tOajhm60IS36G5jQ8uyD+Z1OQ/0nrs=
</data>
</dict>
<key>SellyCloudSDK.bundle/Info.plist</key>
<dict>
<key>hash2</key>
<data>
1xz755nY7h6lkSUYg7ruoqJWl82J717B2ZnTjOsOu8c=
</data>
</dict>
<key>SellyCloudSDK.bundle/black.jpg</key>
<dict>
<key>hash2</key>
<data>
f/1egVxLL/cpZlH6oO6KZcP2KZYR3FE8f5UYnZoIcdk=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

View File

@@ -48,5 +48,4 @@ TODO: Add long description of the pod here.
s.dependency 'YYModel'
s.dependency 'SSZipArchive'
s.dependency 'SocketRocket'
s.dependency 'Logboard', '~> 2.5.0'
end

View File

@@ -4,20 +4,6 @@
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>SellyCloudSDK.framework/SellyCloudSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SellyCloudSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SellyCloudSDK.framework/SellyCloudSDK</string>
@@ -35,6 +21,20 @@
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>SellyCloudSDK.framework/SellyCloudSDK</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>SellyCloudSDK.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>

View File

@@ -98,7 +98,7 @@
</data>
<key>Info.plist</key>
<data>
a200xBM1T06w4Zdq8oUtiWEXBrU=
2dWhPoxwZhcWArWRLGHZVPNlwNY=
</data>
<key>Modules/module.modulemap</key>
<data>
@@ -106,7 +106,7 @@
</data>
<key>SellyCloudSDK.bundle/Info.plist</key>
<data>
Zcy54QYywGsEsHyfl2z52zhHmZc=
MaHS7sft9qCdScbxOphx0/Y4cxk=
</data>
<key>SellyCloudSDK.bundle/black.jpg</key>
<data>
@@ -287,7 +287,7 @@
<dict>
<key>hash2</key>
<data>
8xDY4U8V5jg6ERiBFPW1rt1d83OLDKY4i9jyLK5jgy8=
1xz755nY7h6lkSUYg7ruoqJWl82J717B2ZnTjOsOu8c=
</data>
</dict>
<key>SellyCloudSDK.bundle/black.jpg</key>