/// <summary> /// 控件调整处理中心 /// </summary> /// <param name="conferenceAudioItem">语音信息子项</param> /// <param name="isReflesh">是否进行更新</param> public static void ControlChangeDealWidthCenter(ConferenceAudioItem conferenceAudioItem, bool isReflesh) { try { //语音信息类型 AudioItemType audioItemType = default(AudioItemType); //是否为主持人 if (IMMCodeEnterEntity.IsMeetingPresenter) { //是否包含音频文件 if (!string.IsNullOrEmpty(conferenceAudioItem.AudioUrl)) { //包含语音 audioItemType = AudioItemType.LimitHasAudio; } else { //不包含语音 audioItemType = AudioItemType.LimitNoAudio; } } else { //是否包含音频文件 if (!string.IsNullOrEmpty(conferenceAudioItem.AudioUrl)) { //包含语音 audioItemType = AudioItemType.NoLimitHasAudio; } else { //不包含语音 audioItemType = AudioItemType.NoLimitNoAudio; } } //控件调整 conferenceAudioItem.MesuareAudioItem(audioItemType, isReflesh); } catch (Exception ex) { LogManage.WriteLog(typeof(ConferenceAudio_View), ex); } finally { } }
/// <summary> /// 创建音频 /// </summary> /// <param name="type"></param> /// <param name="url"></param> /// <param name="id"></param> /// <param name="owner"></param> /// <param name="volume"></param> /// <param name="loop"></param> /// <param name="playWhenLoaded"></param> /// <param name="callback"></param> /// <returns></returns> private AudioItem CreateAudioItem(AudioItemType type, string url, string id = null, string owner = null, float volume = 1f, bool loop = false, bool playWhenLoaded = false, Action <AudioItem> callback = null) { AudioItem item = new AudioItem(); item.type = type; item.id = id; item.owner = owner; item.callback = callback; AudioPlayer player = App.objectPoolManager.GetObject <AudioPlayer>(); player.url = url; player.volume = volume; player.loop = loop; player.playWhenLoaded = playWhenLoaded; player.audioSource = behaviour.gameObject.AddComponent <AudioSource>(); item.player = player; return(item); }
/// <summary> /// 控件调整局部调整 /// </summary> /// <param name="audioItemType"></param> /// <param name="isReflesh"></param> public void MesuareAudioItem(AudioItemType audioItemType, bool isReflesh) { try { switch (audioItemType) { case AudioItemType.LimitHasAudio: //带语音(有权限) this.LimitHasAudio(isReflesh); break; case AudioItemType.LimitNoAudio: //不带语音(有权限) this.LimitNoAudio(); break; case AudioItemType.NoLimitHasAudio: //带语音(无权限) this.NoLimitHasAudio(isReflesh); break; case AudioItemType.NoLimitNoAudio: //不带语音(无权限) this.NoLimitNoAudio(); break; case AudioItemType.DeleteTipControl: //移除上传提示 this.DeleteTipControl(isReflesh); break; default: break; } } catch (Exception ex) { LogManage.WriteLog(this.GetType(), ex); } finally { } }