BGKSYAgoraStreamerBaseController.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // BGKSYAgoraStreamerBaseController.h
  3. // FanweLive
  4. //
  5. // Created by yiqian on 10/15/15.
  6. // Copyright (c) 2015 qyvideo. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <GPUImage/GPUImage.h>
  10. #import <libksygpulive/KSYGPUStreamerKit.h>
  11. #import "KSYRTCStreamerKit.h"
  12. #import "KSYAgoraStreamerKit.h"
  13. #define SEL_VALUE(SEL_NAME) [NSValue valueWithPointer:@selector(SEL_NAME)]
  14. @class BGKSYAgoraStreamerBaseController;
  15. @protocol FWKSYAgoraStreamerBaseControllerDelegate <NSObject>
  16. @required
  17. // 首帧回调
  18. - (void)firstAgoraFrame:(BGKSYAgoraStreamerBaseController *)publishVC;
  19. // 网络断连,且经多次重连抢救无效后退出直播
  20. - (void)exitAgoraPublish:(BGKSYAgoraStreamerBaseController *)publishVC;
  21. /*
  22. * 声网连麦/断开连麦
  23. * isLinked:YES:连麦 NO:断开连麦
  24. * applicantId:申请连麦者ID
  25. */
  26. - (void)linkOrBreakMick:(BOOL)isLinked applicantId:(NSString *)applicantId;
  27. @end
  28. @interface BGKSYAgoraStreamerBaseController : UIViewController
  29. {
  30. }
  31. @property (nonatomic, weak) id<FWKSYAgoraStreamerBaseControllerDelegate> delegate;
  32. @property (nonatomic, assign) NSInteger liveType; // 视频类型,对应枚举FW_LIVE_TYPE
  33. #if TARGET_IPHONE_SIMULATOR
  34. @property (nonatomic, strong) KSYGPUStreamerKit *gPUStreamerKit; // 直播推流工具类
  35. #else
  36. @property (nonatomic, strong) KSYAgoraStreamerKit *gPUStreamerKit; // 直播推流工具类
  37. #endif
  38. @property (nonatomic, strong) UIView *videoContrainerView; // 视频容器视图
  39. @property (nonatomic, strong) NSURL *pushUrl; // 推流地址
  40. @property (nonatomic, copy) NSString *applicantId; // 申请连麦者的ID
  41. @property (nonatomic, assign) BOOL isApplicant; // YES:申请连麦者 NO:接收连麦者
  42. /*
  43. @abstract start call的回调函数
  44. */
  45. @property (nonatomic, copy)void (^onMyCallStart)(int status);
  46. /*
  47. @abstract stop call的回调函数
  48. */
  49. @property (nonatomic, copy)void (^onMyCallStop)(int status);
  50. /*
  51. @abstract 加入channel回调
  52. */
  53. @property (nonatomic, copy)void (^onMyChannelJoin)(int status);
  54. // 开始推流
  55. - (void)startRtmp;
  56. // 停止推流
  57. - (void)stopRtmp;
  58. /*
  59. * 开始连麦
  60. * applicantId:申请连麦者ID
  61. * responderId:接收连麦者ID
  62. * roomId:房间ID
  63. */
  64. - (void)startLinkMic:(NSString *)applicantId andResponderId:(NSString *)responderId roomId:(NSString *)roomId;
  65. /*
  66. * 停止连麦
  67. * applicantId:申请连麦者ID
  68. */
  69. - (void)stopLinkMic:(NSString *)applicantId;
  70. -(void)PkWithRoomId:(NSString *)roomid;
  71. //重新加载推流
  72. -(void)reloadRtmp;
  73. @end