BGTPlayController.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. //
  2. // BGTPlayController.h
  3. // BuguLive
  4. //
  5. // Created by xfg on 16/12/5.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <TXLiteAVSDK_Professional/TXLivePlayer.h>
  10. #import <TXLiteAVSDK_Professional/TXLivePush.h>
  11. #import <Foundation/Foundation.h>
  12. #import <AVFoundation/AVFoundation.h>
  13. #import <TXLiteAVSDK_Professional/TXLivePushListener.h>
  14. @class BGTPlayController;
  15. @protocol FWTPlayControllerDelegate <NSObject>
  16. @required
  17. // 结束回播,用来判断是否还有下一段回播
  18. - (void)stopReLive;
  19. // 首帧回调
  20. - (void)firstFrame:(BGTPlayController*)playVC;
  21. // 网络断连,且经多次重连抢救无效后退出app
  22. - (void)exitPlayAndApp:(BGTPlayController*)publishVC;
  23. // 网络断连,重连
  24. - (void)playAgain:(BGTPlayController*)publishVC isHideLeaveTip:(BOOL)isHideLeaveTip;
  25. @end
  26. @interface BGTPlayController : UIViewController
  27. {
  28. UITextView* _statusView;
  29. UITextView* _logViewEvt;
  30. unsigned long long _startTime;
  31. unsigned long long _lastTime;
  32. UIView* _cover;
  33. BOOL _screenPortrait;
  34. BOOL _renderFillScreen;
  35. BOOL _log_switch;
  36. AVCaptureSession * _VideoCaptureSession;
  37. NSString* _logMsg;
  38. NSString* _tipsMsg;
  39. NSString* _testPath;
  40. NSInteger _cacheStrategy;
  41. UIButton* _btnCacheStrategy;
  42. UIControl* _vCacheStrategy;
  43. UIButton* _radioBtnFast;
  44. UIButton* _radioBtnSmooth;
  45. UIButton* _radioBtnAUTO;
  46. NSInteger _rePlayTime;
  47. UIView *blueBgView;
  48. UIView *redBgView;
  49. //UIImageView *pkBgView;
  50. }
  51. @property (nonatomic, weak) id<FWTPlayControllerDelegate>delegate;
  52. @property (nonatomic, strong) UIImageView *pkBgView;
  53. @property (nonatomic, strong) TXLivePlayer *txLivePlayer;
  54. @property (nonatomic, strong) TXLivePlayer *rightTxLivePlayer;
  55. @property (nonatomic, strong) UIView *videoContrainerView; // 放置视频的view
  56. //声网dev
  57. @property (nonatomic, strong) UIView *videoContrainerViewAgora; // 放置视频的view
  58. @property (nonatomic, strong) UIView *rightVideoContrainerView; // 放置视频的view
  59. @property (nonatomic, assign) NSInteger playLiveType; // 视频类型,对应枚举FW_LIVE_TYPE
  60. @property (nonatomic, assign) NSInteger create_type; //
  61. @property (nonatomic, copy) NSString *playUrlStr; // 播放地址
  62. @property (nonatomic, assign) BOOL isLivePlay; // YES:直播的观众(拉流) NO:点播(回播、回看)
  63. @property (nonatomic, assign) BOOL play_switch; // NO:第一次播放 YES:播放、暂停
  64. @property (nonatomic, strong) UISlider *playProgress; // 进度条
  65. @property (nonatomic, strong) UILabel *playStart; // 播放时间
  66. @property (nonatomic, strong) UIButton *btnPlay; // 开始按钮
  67. @property (nonatomic, copy) NSString *kbpsSendStr; // 发送码率
  68. @property (nonatomic, copy) NSString *kbpsRecvStr; // 接收码率
  69. @property (nonatomic, strong) NSDictionary *qualityDict; // 直播质量相关参数
  70. @property(nonatomic, strong) NSString *agora_token;
  71. @property(nonatomic, strong) NSString *roomIDStr;
  72. // 开始拉流
  73. - (BOOL)startRtmp:(NSInteger)create_type;
  74. // 停止拉流
  75. - (void)stopRtmp;
  76. // app进入后台
  77. - (void)onAppDidEnterBackGround;
  78. // app将要进入前台
  79. - (void)onAppWillEnterForeground;
  80. // 声音打断监听
  81. - (void)onAudioInterruption:(NSNotification *)notification;
  82. - (void)onPlayEvent:(int)EvtID withParam:(NSDictionary*)param;
  83. - (void)onNetStatus:(NSDictionary*) param;
  84. - (void)toastTip:(NSString*)toastInfo;
  85. // ----------------回播专用-----------------
  86. // 点击开始回播按钮
  87. - (void)clickPlay:(UIButton *)sender create_type:(NSInteger)create_type;
  88. // 改变进度条
  89. - (void)onSeek:(UISlider *)slider;
  90. // 点击进度条
  91. - (void)onSeekBegin:(UISlider *)slider;
  92. // 拖动进度条
  93. - (void)onDrag:(UISlider *)slider;
  94. // 结束拖动
  95. - (void)dragSliderDidEnd:(UISlider *)slider;
  96. @end