您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ConnectionService.js 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. import { NativeEventEmitter, NativeModules } from 'react-native';
  2. let ConnectionService = NativeModules.ConnectionService;
  3. // XXX Rather than wrapping ConnectionService in a new class and forwarding
  4. // the many methods of the latter to the former, add the one additional
  5. // method that we need to ConnectionService.
  6. if (ConnectionService) {
  7. const eventEmitter = new NativeEventEmitter(ConnectionService);
  8. ConnectionService = {
  9. ...ConnectionService,
  10. addListener: eventEmitter.addListener.bind(eventEmitter),
  11. registerSubscriptions(context, delegate) {
  12. return [
  13. ConnectionService.addListener(
  14. 'org.jitsi.meet:features/connection_service#disconnect',
  15. delegate._onPerformEndCallAction,
  16. context),
  17. ConnectionService.addListener(
  18. 'org.jitsi.meet:features/connection_service#abort',
  19. delegate._onPerformEndCallAction,
  20. context)
  21. ];
  22. },
  23. setMuted() {
  24. // Currently no-op, but remember to remove when implemented on
  25. // the native side
  26. }
  27. };
  28. }
  29. export default ConnectionService;