Пример #1
0
 public static IAliRtcEngine GetEngine(string extras)
 {
     if (instance == null)
     {
         instance = new IAliRtcEngine(extras);
     }
     return(instance);
 }
Пример #2
0
        private static void OnUpdateRoleNotifyCallback(int oldRole, int newRole)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnUpdateRoleNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnUpdateRoleNotify(oldRole, newRole);
                });
            }
#else
            if ((instance.OnUpdateRoleNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnUpdateRoleNotify(oldRole, newRole);
                });
            }
#endif
        }
Пример #3
0
        private static void OnOccurErrorNotifyCallback(int error)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnOccurErrorNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnOccurErrorNotify(error);
                });
            }
#else
            if ((instance.OnOccurErrorNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnOccurErrorNotify(error);
                });
            }
#endif
        }
Пример #4
0
        private static void OnLeaveChannelResultNotifyCallback(int result)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnLeaveChannelResultNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnLeaveChannelResultNotify(result);
                });
            }
#else
            if ((instance.OnLeaveChannelResultNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnLeaveChannelResultNotify(result);
                });
            }
#endif
        }
Пример #5
0
        private static void OnConnectionRecoveryNotifyCallback()
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if (IAliRtcEngine.OnConnectionRecoveryNotify != null && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnConnectionRecoveryNotify();
                });
            }
#else
            if (instance.OnConnectionRecoveryNotify != null && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnConnectionRecoveryNotify();
                });
            }
#endif
        }
Пример #6
0
        private static void OnNetworkQualityChangedNotifyCallback(string userId, int upQuality, int downQuality)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnNetworkQualityChangedNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnNetworkQualityChangedNotify(userId, upQuality, downQuality);
                });
            }
#else
            if ((instance.OnNetworkQualityChangedNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnNetworkQualityChangedNotify(userId, upQuality, downQuality);
                });
            }
#endif
        }
Пример #7
0
        private static void OnSubscribeChangedNotifyCallback(string userId, int audioTrack, int videoTrack)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnSubscribeChangedNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnSubscribeChangedNotify(userId, audioTrack, videoTrack);
                });
            }
#else
            if ((instance.OnSubscribeChangedNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnSubscribeChangedNotify(userId, audioTrack, videoTrack);
                });
            }
#endif
        }
Пример #8
0
        private static void OnRemoteUserOffLineNotifyCallback(string userId)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnRemoteUserOffLineNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnRemoteUserOffLineNotify(userId);
                });
            }
#else
            if ((instance.OnRemoteUserOffLineNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnRemoteUserOffLineNotify(userId);
                });
            }
#endif
        }
Пример #9
0
        private static void OnJoinChanneNotifyCallback(int errorCode)
        {
#if UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
            if ((IAliRtcEngine.OnJoinChannelNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    IAliRtcEngine.OnJoinChannelNotify(errorCode);
                });
            }
#else
            if (instance != null && (instance.OnJoinChannelNotify != null) && AliRtcEngineCallBackQueue.Current != null)
            {
                AliRtcEngineCallBackQueue.Current.EnQueue(() =>
                {
                    instance.OnJoinChannelNotify(errorCode);
                });
            }
#endif
        }