PlayerViewController.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. //
  2. // PlayerViewController.h
  3. // VclustersGemini
  4. //
  5. // Created by APPLE on 2019/6/13.
  6. // Copyright © 2019 APPLE. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "BaseViewController.h"
  10. #import "PlayerView.h"
  11. #import <RCCloudPhoneSDK/RCAudioPlayer.h>
  12. #import <RCCloudPhoneSDK/RCCommandChannel.h>
  13. #import "PlayerControlButTipView.h"
  14. #import "Const.h"
  15. @protocol PlayerViewControllerDelegate <NSObject>
  16. @optional
  17. - (void)playerViewControllerBackWithPhoneIndex:(NSInteger)phoneIndex;
  18. - (void)shortcutBackWithPhoneID:(NSInteger)phoneID phoneVaild:(BOOL)phoneVaild; // 快捷方式 云手机已过期
  19. // 激活码试用云手机续费
  20. - (void)playerViewControllerActiveCodeRenewBackWithPhoneIndex:(NSInteger)phoneIndex;
  21. @end
  22. @class AdvertItemModel;
  23. @class PlayerControlView;
  24. @interface PlayerViewController : BaseViewController
  25. {
  26. __block NSInteger deviceShareStates;/*设备状态*/
  27. PlayerControlView *controlView;
  28. /**
  29. * @brief 标记是否有返回上一级
  30. */
  31. BOOL haveBack;
  32. PlayerView *mPlayerView;
  33. NSLock *connectLock;
  34. CIImage *saveCIImage; //保存流,取最后一张图片
  35. RCMAACPlayer *aacPlayer;
  36. UIView *wattingView;
  37. }
  38. @property(copy,nonatomic)NSString * _Nullable internetVideoPort;
  39. @property(copy,nonatomic)NSString *ip;
  40. @property(copy,nonatomic)NSString *deviceId;
  41. @property(nonatomic,assign)BOOL canControl;/*是否可以控制设备*/
  42. @property(strong,nonatomic)PlayerControlButTipView *PlayerControlButTipV;
  43. /**
  44. * @brief vpnStatus 1:开启 0:关闭
  45. */
  46. @property (nonatomic, assign) NSInteger vpnStatus;
  47. /**
  48. * @brief internetHttp websocket指令通道连接
  49. */
  50. @property (nonatomic, copy) NSString *internetHttp;
  51. @property (nonatomic, strong) RCCommandChannelManager *commandChannelManager;//指令通道
  52. @property (nonatomic, strong) RCCommandChannelManager *businessCommandChannelManager;//业务通道
  53. /**是否延迟发送打开app指令*/
  54. @property (nonatomic, assign) BOOL delayPostOpenAppOrder;
  55. /**
  56. * @brief 编码类型是否支持h265
  57. */
  58. @property(nonatomic, assign) BOOL isSupportH265Type;
  59. /**页面跳转-需不需要回收资源*/
  60. @property (nonatomic, assign) BOOL isNeedRecyclResource;
  61. /**音视频是否连接成功*/
  62. @property (nonatomic, assign) BOOL isConnectSuccess;
  63. /**0:初始状态 1:切换云手机超分 2:token失效超分*/
  64. @property (nonatomic, assign) NSInteger rbdNotification;
  65. //第一次链接设备 要发送指令信息 实现单点登录
  66. @property (nonatomic, assign)BOOL didSendfristMsg;
  67. @property (nonatomic, assign) BOOL isPwdVCShow;//当前是否有密码页面
  68. //第一次链接设备 要发送指令信息 实现单点登录
  69. @property (nonatomic, assign)BOOL isLoginAgainType;
  70. /**
  71. * @brief 云手机类型 VIP星动云手机 SVIP星曜云手机 STAR 唔即云手机
  72. */
  73. @property(copy,nonatomic)NSString *buyVipType;
  74. //最后一帧回调
  75. @property (nonatomic, copy) void (^block)(void); //saveCIImageAction
  76. //返回回传 最后一帧
  77. @property (nonatomic, copy) void (^LastImageblock)(UIImage *image,NSString *deviceId,NSArray *cloudPhones); //saveCIImageAction
  78. //弹窗广告点击
  79. @property (nonatomic, copy) void (^AdvertBlock)(AdvertItemModel *model);
  80. @property (nonatomic, weak) id<PlayerViewControllerDelegate> delegate;
  81. @property (nonatomic, strong) UIAlertController *alertController;
  82. typedef void(^sureActionBlock)(UIAlertController *alertView);
  83. typedef void(^cancelActionBlock)(UIAlertController *alertController);
  84. typedef void(^completiongeBlock) (int stats , NSString *backData);
  85. /*更新云手机分辨率*/
  86. - (void)updatePhoneReslotings;
  87. - (void)addLoadingWithTipsView:(NSString *)tipsStr;
  88. -(void)showNewIndicator;
  89. -(void)removeNewIndicator;
  90. - (void)removeLoadingWithTipsView;
  91. -(void)initAlertWithTitle:(NSString *_Nullable)title message:(NSString *)message sureActionBlock:(sureActionBlock)sureActionBlock;
  92. - (void)saveCIImageAction:(NSString *)deviceId;
  93. - (void)toStopRecoder;
  94. - (void)toStopAudioRecoder;
  95. - (void)removeNSNotification;
  96. - (void)addNSNotification;
  97. - (void)initData;
  98. - (BOOL)initVideoServer;
  99. - (void)connectVideoServer;
  100. - (NSArray *)getAllIvar:(id)object;
  101. - (void)updatemPlayerView;
  102. - (void)tryAgain;
  103. - (void)requestIFrame;
  104. - (void)disconnectVideoServer;
  105. - (void)send_data:(NSString *)dataStr;
  106. - (void)toUpdateDeviceUse;
  107. - (void)phoneSelectWithIndex:(NSInteger)index;
  108. - (void)exitPlayerView;/*退出推拉流*/
  109. /**清除试用广告*/
  110. - (void)extensionClearTrialAD;
  111. - (void)showYearCardNoTime;
  112. - (void)showChangPhoneTipsWithPhone:(NSInteger)index;
  113. #pragma mark - 提示框
  114. - (void)showAlertWithTitle:(NSAttributedString*_Nullable)atbTitle
  115. message:(NSAttributedString*_Nullable)atbmessage
  116. tilteAlignment:(NSTextAlignment)tilteAlignment
  117. messageAlignment:(NSTextAlignment)messageAlignment
  118. sureAction:(UIAlertAction*_Nullable)sureAction
  119. cancelAction:(UIAlertAction*_Nullable)cancelAction;
  120. - (void)openbusinessCommandChannelManagerrc_openURL;
  121. - (void)opencommandChannelManagerrc_openURL;
  122. #pragma mark - 设置是否可以播放声音和动画
  123. -(void)setShowImgAndVoiceTypeFun:(bool)isCan;
  124. @end