Nav apraksta

RCTAgoraVideoView.m 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // RCTAgoraVideoView.m
  3. // RCTAgora
  4. //
  5. // Created by 邓博 on 2017/6/30.
  6. // Copyright © 2017年 Syan. All rights reserved.
  7. //
  8. #import "RCTAgoraVideoView.h"
  9. @implementation RCTAgoraVideoView
  10. - (instancetype)init{
  11. if (self == [super init]) {
  12. _rtcEngine = [AgoraConst share].rtcEngine;
  13. }
  14. return self;
  15. }
  16. //- (void)setLocalUid:(NSInteger)localUid {
  17. // if (localUid == 0) {
  18. // AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
  19. // canvas.uid = localUid;
  20. // canvas.view = self;
  21. // canvas.renderMode = AgoraRtc_Render_Hidden;
  22. // [_rtcEngine setupLocalVideo:canvas];
  23. // }
  24. //}
  25. - (void)setShowLocalVideo:(Boolean)showLocalVideo {
  26. if (showLocalVideo) {
  27. AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
  28. canvas.uid = [AgoraConst share].localUid;
  29. canvas.view = self;
  30. canvas.renderMode = AgoraRtc_Render_Hidden;
  31. [_rtcEngine setupLocalVideo:canvas];
  32. }
  33. }
  34. -(void)setRemoteUid:(NSInteger)remoteUid {
  35. if (remoteUid > 0) {
  36. AgoraRtcVideoCanvas *canvas = [[AgoraRtcVideoCanvas alloc] init];
  37. canvas.uid = remoteUid;
  38. canvas.view = self;
  39. canvas.renderMode = AgoraRtc_Render_Hidden;
  40. [_rtcEngine setupRemoteVideo:canvas];
  41. }
  42. }
  43. @end