PBSDK.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // PBSDK.h
  3. // PBSDK
  4. //
  5. // Created by mbp on 2024/12/8.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "PBUserInfo.h"
  9. #define HXAppKey @"1104241202169398#live-video"
  10. #define RtcAppId @"f27f43da2ed24e68ac07e11124011d35"
  11. @import AgoraRtcKit;
  12. NS_ASSUME_NONNULL_BEGIN
  13. @protocol PBSDKDelegate <NSObject>
  14. - (void)pb_rtcEngineRequestToken:(AgoraRtcEngineKit *)engine;
  15. - (void)pb_rtcEngine:(AgoraRtcEngineKit *)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed;
  16. - (void)pb_rtcEngine:(AgoraRtcEngineKit *)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason;
  17. - (void)pb_rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteReason)reason elapsed:(NSInteger)elapsed;
  18. @end
  19. @interface PBAgoraRtcEngineKitCfg: NSObject
  20. /// 声网 appId
  21. @property (nonatomic, copy) NSString *appId;
  22. @end
  23. @interface PBSDK : NSObject
  24. @property (nonatomic,assign) BOOL isUser;//是否是用户 不是则为主播
  25. @property(nonatomic,copy) void (^moduleKeepAliveCallback)(id result, BOOL keepAlive);
  26. @property (nonatomic, weak ) id <PBSDKDelegate> delegate;
  27. @property(nonatomic,copy) void (^navigateToVuePageBlock)(NSString *url);
  28. @property (nonatomic, copy ) NSString *accessToken;
  29. @property (nonatomic, copy ) NSNumber *expiresTime;
  30. @property (nonatomic, copy ) NSString *refreshToken;
  31. @property (nonatomic, strong) AgoraRtcEngineKit *agoraRtcEngineKit;
  32. + (PBSDK *)shared;
  33. + (void)initSDK;
  34. + (BOOL)isLogin;
  35. @property (nonatomic,strong) PBUserInfo *userinfo;
  36. - (void)loginUser;
  37. - (void)openLive;
  38. ///初始化环形
  39. - (void)initiateIM;
  40. + (UIViewController *)yt_topmostViewController;
  41. + (UIViewController *)dc_findCurrentShowingViewController;
  42. @end
  43. NS_ASSUME_NONNULL_END