2022-03-12 06:55:12 +08:00
|
|
|
//
|
|
|
|
// ReactNativeEventEmitter.swift
|
|
|
|
//
|
|
|
|
// Created by Tiago Daniel Jacobs on 11/03/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import React
|
|
|
|
|
|
|
|
@objc(ReactNativeEventEmitter)
|
|
|
|
open class ReactNativeEventEmitter: RCTEventEmitter {
|
|
|
|
|
|
|
|
public static var emitter: RCTEventEmitter!
|
|
|
|
|
|
|
|
public enum EVENT: String, CaseIterable {
|
|
|
|
case onBroadcastRequested = "onBroadcastRequested"
|
|
|
|
case onBroadcastStarted = "onBroadcastStarted"
|
|
|
|
case onBroadcastPaused = "onBroadcastPaused"
|
|
|
|
case onBroadcastResumed = "onBroadcastResumed"
|
|
|
|
case onBroadcastFinished = "onBroadcastFinished"
|
2022-03-19 03:39:14 +08:00
|
|
|
case onScreenShareOfferCreated = "onScreenShareOfferCreated"
|
2022-03-28 02:05:47 +08:00
|
|
|
case onSetScreenShareRemoteSDPCompleted = "onSetScreenShareRemoteSDPCompleted"
|
2022-03-28 09:18:34 +08:00
|
|
|
case onScreenShareLocalIceCandidate = "onScreenShareLocalIceCandidate"
|
|
|
|
case onScreenShareSignalingStateChange = "onScreenShareSignalingStateChange"
|
2022-03-30 01:57:03 +08:00
|
|
|
case onAddScreenShareRemoteIceCandidateCompleted = "onAddScreenShareRemoteIceCandidateCompleted"
|
2022-04-20 07:44:38 +08:00
|
|
|
case onFullAudioOfferCreated = "onFullAudioOfferCreated"
|
|
|
|
case onSetFullAudioRemoteSDPCompleted = "onSetFullAudioRemoteSDPCompleted"
|
2022-03-12 06:55:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
override init() {
|
|
|
|
super.init()
|
|
|
|
ReactNativeEventEmitter.emitter = self
|
|
|
|
}
|
|
|
|
|
|
|
|
open override func supportedEvents() -> [String] {
|
|
|
|
EVENT.allCases.map { $0.rawValue }
|
|
|
|
}
|
|
|
|
|
|
|
|
@objc open override class func requiresMainQueueSetup() -> Bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|