BGTPlayControllerForPK.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // BGTPlayControllerForPK.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 BGTPlayControllerForPK;
  15. @protocol FWTPlayControllerForPKDelegate <NSObject>
  16. @required
  17. // 结束回播,用来判断是否还有下一段回播
  18. - (void)stopReLive;
  19. // 首帧回调
  20. - (void)firstFrame:(BGTPlayControllerForPK*)playVC;
  21. // 网络断连,且经多次重连抢救无效后退出app
  22. - (void)exitPlayAndApp:(BGTPlayControllerForPK*)publishVC;
  23. // 网络断连,重连
  24. - (void)playAgain:(BGTPlayControllerForPK*)publishVC isHideLeaveTip:(BOOL)isHideLeaveTip;
  25. @end
  26. @interface BGTPlayControllerForPK : 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. }
  48. @property (nonatomic, weak) id<FWTPlayControllerForPKDelegate>delegate;
  49. @property (nonatomic, strong) TXLivePlayer *txLivePlayer;
  50. @property (nonatomic, strong) UIView *videoContrainerView; // 放置视频的view
  51. @property (nonatomic, assign) NSInteger liveType; // 视频类型,对应枚举FW_LIVE_TYPE
  52. @property (nonatomic, assign) NSInteger create_type; //
  53. @property (nonatomic, copy) NSString *playUrlStr; // 播放地址
  54. @property (nonatomic, assign) BOOL isLivePlay; // YES:直播的观众(拉流) NO:点播(回播、回看)
  55. @property (nonatomic, assign) BOOL play_switch; // NO:第一次播放 YES:播放、暂停
  56. @property (nonatomic, strong) UISlider *playProgress; // 进度条
  57. @property (nonatomic, strong) UILabel *playStart; // 播放时间
  58. @property (nonatomic, strong) UIButton *btnPlay; // 开始按钮
  59. @property (nonatomic, copy) NSString *kbpsSendStr; // 发送码率
  60. @property (nonatomic, copy) NSString *kbpsRecvStr; // 接收码率
  61. @property (nonatomic, strong) NSDictionary *qualityDict; // 直播质量相关参数
  62. // 开始拉流
  63. - (BOOL)startRtmp:(NSInteger)create_type;
  64. // 停止拉流
  65. - (void)stopRtmp;
  66. // app进入后台
  67. - (void)onAppDidEnterBackGround;
  68. // app将要进入前台
  69. - (void)onAppWillEnterForeground;
  70. // 声音打断监听
  71. - (void)onAudioInterruption:(NSNotification *)notification;
  72. - (void)onPlayEvent:(int)EvtID withParam:(NSDictionary*)param;
  73. - (void)onNetStatus:(NSDictionary*) param;
  74. - (void)toastTip:(NSString*)toastInfo;
  75. // ----------------回播专用-----------------
  76. // 改变进度条
  77. - (void)onSeek:(UISlider *)slider;
  78. // 点击进度条
  79. - (void)onSeekBegin:(UISlider *)slider;
  80. // 拖动进度条
  81. - (void)onDrag:(UISlider *)slider;
  82. // 结束拖动
  83. - (void)dragSliderDidEnd:(UISlider *)slider;
  84. @end