You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ViewController.m 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright @ 2017-present Atlassian Pty Ltd
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "ViewController.h"
  17. @interface ViewController ()
  18. @end
  19. @implementation ViewController
  20. - (void)viewDidLoad {
  21. [super viewDidLoad];
  22. JitsiMeetView *view = (JitsiMeetView *) self.view;
  23. #ifdef DEBUG
  24. view.delegate = self;
  25. // inviteController
  26. InviteController *inviteController = view.inviteController;
  27. //inviteController.addPeopleEnabled = TRUE;
  28. //inviteController.dialOutEnabled = TRUE;
  29. inviteController.delegate = self;
  30. #endif // #ifdef DEBUG
  31. // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do want
  32. // the Welcome page to be enabled. It defaults to disabled in the SDK at the
  33. // time of this writing but it is clearer to be explicit about what we want
  34. // anyway.
  35. view.welcomePageEnabled = YES;
  36. [view loadURL:nil];
  37. }
  38. #if DEBUG
  39. void _onJitsiMeetViewDelegateEvent(NSString *name, NSDictionary *data) {
  40. NSLog(
  41. @"[%s:%d] JitsiMeetViewDelegate %@ %@",
  42. __FILE__, __LINE__, name, data);
  43. }
  44. - (void)conferenceFailed:(NSDictionary *)data {
  45. _onJitsiMeetViewDelegateEvent(@"CONFERENCE_FAILED", data);
  46. }
  47. - (void)conferenceJoined:(NSDictionary *)data {
  48. _onJitsiMeetViewDelegateEvent(@"CONFERENCE_JOINED", data);
  49. }
  50. - (void)conferenceLeft:(NSDictionary *)data {
  51. _onJitsiMeetViewDelegateEvent(@"CONFERENCE_LEFT", data);
  52. }
  53. - (void)conferenceWillJoin:(NSDictionary *)data {
  54. _onJitsiMeetViewDelegateEvent(@"CONFERENCE_WILL_JOIN", data);
  55. }
  56. - (void)conferenceWillLeave:(NSDictionary *)data {
  57. _onJitsiMeetViewDelegateEvent(@"CONFERENCE_WILL_LEAVE", data);
  58. }
  59. - (void)loadConfigError:(NSDictionary *)data {
  60. _onJitsiMeetViewDelegateEvent(@"LOAD_CONFIG_ERROR", data);
  61. }
  62. - (void)beginAddPeople:(AddPeopleController *)addPeopleController {
  63. NSLog(
  64. @"[%s:%d] InviteControllerDelegate %s",
  65. __FILE__, __LINE__, __FUNCTION__);
  66. // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise, it
  67. // is going to be memory-leaked in the associated InviteController and no
  68. // subsequent InviteButton clicks/taps will be delivered.
  69. [addPeopleController endAddPeople];
  70. }
  71. #endif // #ifdef DEBUG
  72. @end