ws重连,ws、trtc联网状态,静音按钮分开
This commit is contained in:
parent
50c4e64b5b
commit
3536c74614
|
@ -57,7 +57,7 @@ namespace JianGongYun.TRTC
|
||||||
/// 直播窗口
|
/// 直播窗口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LiveWindow CurrentLiveWindow;
|
public static LiveWindow CurrentLiveWindow;
|
||||||
private static LiveWindowViewModel liveWinMode;
|
public static LiveWindowViewModel liveWinMode;
|
||||||
public static ClassroomEntity CurrentClassroomEntity { get; private set; }
|
public static ClassroomEntity CurrentClassroomEntity { get; private set; }
|
||||||
public static TRTCCloudCallback TRTCCloudCallback = new TRTCCloudCallback();
|
public static TRTCCloudCallback TRTCCloudCallback = new TRTCCloudCallback();
|
||||||
|
|
||||||
|
@ -142,19 +142,30 @@ namespace JianGongYun.TRTC
|
||||||
|
|
||||||
var url = new Uri(WSUrl);
|
var url = new Uri(WSUrl);
|
||||||
WSClient = new WebsocketClient(url);
|
WSClient = new WebsocketClient(url);
|
||||||
WSClient.ReconnectTimeout = TimeSpan.FromSeconds(30);
|
WSClient.ErrorReconnectTimeout = TimeSpan.FromSeconds(10);
|
||||||
WSClient.ReconnectionHappened.Subscribe(info =>
|
WSClient.ReconnectTimeout = TimeSpan.FromSeconds(10);
|
||||||
Console.WriteLine($"Reconnection happened, type: {info.Type}"));
|
WSClient.ReconnectionHappened.Subscribe((info) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Reconnection happened, type: {info.Type}");
|
||||||
|
WSClient.Send($"{{code:10000,nick:\"{CurrentClassroomEntity.TeacherName}\",\"room\":\"push_{ClassId}\"}}");//进房间
|
||||||
|
liveWinMode.WSConneced = true;
|
||||||
|
});
|
||||||
|
WSClient.DisconnectionHappened.Subscribe((info) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine($"DisconnectionHappened happened, type: {info.Type}, {info.CloseStatusDescription}");
|
||||||
|
liveWinMode.WSConneced = false;
|
||||||
|
});
|
||||||
WSClient.MessageReceived.Subscribe(CurrentLiveWindow.OnMsg);
|
WSClient.MessageReceived.Subscribe(CurrentLiveWindow.OnMsg);
|
||||||
WSClient.Start();
|
WSClient.Start();
|
||||||
ClassId = CurrentClassroomEntity.TeacherId.Split('_')[1];
|
ClassId = CurrentClassroomEntity.TeacherId.Split('_')[1];
|
||||||
WSClient.Send($"{{code:10000,nick:\"{CurrentClassroomEntity.TeacherName}\",\"room\":\"push_{ClassId}\"}}");//进房间
|
|
||||||
|
|
||||||
//发送心跳包
|
//发送心跳包
|
||||||
Heartbeat = new DispatcherTimer(DispatcherPriority.Render);
|
Heartbeat = new DispatcherTimer(DispatcherPriority.Render);
|
||||||
Heartbeat.Interval = TimeSpan.FromSeconds(5);
|
Heartbeat.Interval = TimeSpan.FromSeconds(5);
|
||||||
Heartbeat.Tick += new EventHandler((a, b) => WSClient.Send("{code:10016}"));
|
Heartbeat.Tick += new EventHandler((a, b) =>
|
||||||
|
{
|
||||||
|
WSClient.Send("{code:10016}");//向服务器发送心跳包
|
||||||
|
});
|
||||||
Heartbeat.Start();
|
Heartbeat.Start();
|
||||||
|
|
||||||
callerWindow?.Hide();//隐藏调用窗口
|
callerWindow?.Hide();//隐藏调用窗口
|
||||||
|
@ -403,18 +414,24 @@ namespace JianGongYun.TRTC
|
||||||
//lTRTCCloud.muteLocalAudio(false);
|
//lTRTCCloud.muteLocalAudio(false);
|
||||||
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, settingWindowViewModel.MicVolume);
|
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, settingWindowViewModel.MicVolume);
|
||||||
lTRTCCloud.stopSystemAudioLoopback();
|
lTRTCCloud.stopSystemAudioLoopback();
|
||||||
|
liveWinMode.MicMute = false;
|
||||||
|
liveWinMode.SysMute = true;
|
||||||
}
|
}
|
||||||
else if (settingWindowViewModel.AudioSource == "2")
|
else if (settingWindowViewModel.AudioSource == "2")
|
||||||
{
|
{
|
||||||
//lTRTCCloud.muteLocalAudio(true);
|
//lTRTCCloud.muteLocalAudio(true);
|
||||||
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, 0);
|
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, 0);
|
||||||
lTRTCCloud.startSystemAudioLoopback(null);
|
lTRTCCloud.startSystemAudioLoopback(null);
|
||||||
|
liveWinMode.MicMute = true;
|
||||||
|
liveWinMode.SysMute = false;
|
||||||
}
|
}
|
||||||
else if (settingWindowViewModel.AudioSource == "3")
|
else if (settingWindowViewModel.AudioSource == "3")
|
||||||
{
|
{
|
||||||
//lTRTCCloud.muteLocalAudio(false);
|
//lTRTCCloud.muteLocalAudio(false);
|
||||||
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, settingWindowViewModel.MicVolume);
|
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, settingWindowViewModel.MicVolume);
|
||||||
lTRTCCloud.startSystemAudioLoopback(null);
|
lTRTCCloud.startSystemAudioLoopback(null);
|
||||||
|
liveWinMode.MicMute = false;
|
||||||
|
liveWinMode.SysMute = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -435,21 +452,37 @@ namespace JianGongYun.TRTC
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置麦克风静音
|
/// 设置麦克风静音
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SetMicMute(bool? mute = true)
|
public static void SetMicMute(bool? mute = true, string tag = "mic")
|
||||||
{
|
{
|
||||||
if (liveWinMode.MicRunning)
|
if (liveWinMode.MicRunning)
|
||||||
{
|
{
|
||||||
liveWinMode.MicMute = mute.HasValue ? mute.Value : !liveWinMode.MicMute;
|
if (tag=="mic")
|
||||||
if (liveWinMode.MicMute)
|
|
||||||
{
|
{
|
||||||
//lTRTCCloud.muteLocalAudio(true);
|
liveWinMode.MicMute = mute.HasValue ? mute.Value : !liveWinMode.MicMute;
|
||||||
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, 0);
|
if (liveWinMode.MicMute)
|
||||||
lTRTCCloud.stopSystemAudioLoopback();
|
{
|
||||||
|
//lTRTCCloud.muteLocalAudio(true);
|
||||||
|
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//EnableAudio();
|
||||||
|
lTXDeviceManager.setCurrentDeviceVolume(ManageLiteAV.TRTCDeviceType.TXMediaDeviceTypeMic, settingWindowViewModel.MicVolume);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EnableAudio();
|
liveWinMode.SysMute = mute.HasValue ? mute.Value : !liveWinMode.SysMute;
|
||||||
|
if (liveWinMode.SysMute)
|
||||||
|
{
|
||||||
|
|
||||||
|
lTRTCCloud.stopSystemAudioLoopback();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lTRTCCloud.startSystemAudioLoopback(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//lTRTCCloud.muteLocalAudio(liveWinMode.MicMute);
|
//lTRTCCloud.muteLocalAudio(liveWinMode.MicMute);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using ManageLiteAV;
|
using AduSkin.Controls.Metro;
|
||||||
|
using ManageLiteAV;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
@ -10,82 +11,96 @@ namespace JianGongYun.TRTC.Utils
|
||||||
{
|
{
|
||||||
public void onAudioDeviceCaptureVolumeChanged(uint volume, bool muted)
|
public void onAudioDeviceCaptureVolumeChanged(uint volume, bool muted)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAudioDevicePlayoutVolumeChanged(uint volume, bool muted)
|
public void onAudioDevicePlayoutVolumeChanged(uint volume, bool muted)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAudioEffectFinished(int effectId, int code)
|
public void onAudioEffectFinished(int effectId, int code)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCameraDidReady()
|
public void onCameraDidReady()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onConnectionLost()
|
public void onConnectionLost()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
|
LiveClassroom.liveWinMode.TRTCConneced = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onConnectionRecovery()
|
public void onConnectionRecovery()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
|
LiveClassroom.liveWinMode.TRTCConneced = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onConnectOtherRoom(string userId, TXLiteAVError errCode, string errMsg)
|
public void onConnectOtherRoom(string userId, TXLiteAVError errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDeviceChange(string deviceId, TRTCDeviceType type, TRTCDeviceState state)
|
public void onDeviceChange(string deviceId, TRTCDeviceType type, TRTCDeviceState state)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDisconnectOtherRoom(TXLiteAVError errCode, string errMsg)
|
public void onDisconnectOtherRoom(TXLiteAVError errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEnterRoom(int result)
|
public void onEnterRoom(int result)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
|
if (result > 0)
|
||||||
|
{
|
||||||
|
LiveClassroom.liveWinMode.TRTCConneced = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(TXLiteAVError errCode, string errMsg, IntPtr arg)
|
public void onError(TXLiteAVError errCode, string errMsg, IntPtr arg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name + " " + errCode + " " + errMsg);
|
||||||
|
if (errCode == TXLiteAVError.ERR_ROOM_REQUEST_ENTER_ROOM_TIMEOUT)
|
||||||
|
{
|
||||||
|
LiveClassroom.CurrentLiveWindow.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
AduMessageBox.ShowOK("进入教室超时,请检查网络连接是否正常!", "提醒", "确定");
|
||||||
|
Environment.Exit(0);
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onExitRoom(int reason)
|
public void onExitRoom(int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFirstAudioFrame(string userId)
|
public void onFirstAudioFrame(string userId)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onFirstVideoFrame(string userId, TRTCVideoStreamType streamType, int width, int height)
|
public void onFirstVideoFrame(string userId, TRTCVideoStreamType streamType, int width, int height)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMicDidReady()
|
public void onMicDidReady()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onMissCustomCmdMsg(string userId, int cmdId, int errCode, int missed)
|
public void onMissCustomCmdMsg(string userId, int cmdId, int errCode, int missed)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onNetworkQuality(TRTCQualityInfo localQuality, TRTCQualityInfo[] remoteQuality, uint remoteQualityCount)
|
public void onNetworkQuality(TRTCQualityInfo localQuality, TRTCQualityInfo[] remoteQuality, uint remoteQualityCount)
|
||||||
|
@ -95,92 +110,92 @@ namespace JianGongYun.TRTC.Utils
|
||||||
|
|
||||||
public void onPlayBGMBegin(TXLiteAVError errCode)
|
public void onPlayBGMBegin(TXLiteAVError errCode)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlayBGMComplete(TXLiteAVError errCode)
|
public void onPlayBGMComplete(TXLiteAVError errCode)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPlayBGMProgress(uint progressMS, uint durationMS)
|
public void onPlayBGMProgress(uint progressMS, uint durationMS)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRecvCustomCmdMsg(string userId, int cmdID, uint seq, byte[] msg, uint msgSize)
|
public void onRecvCustomCmdMsg(string userId, int cmdID, uint seq, byte[] msg, uint msgSize)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRecvSEIMsg(string userId, byte[] message, uint msgSize)
|
public void onRecvSEIMsg(string userId, byte[] message, uint msgSize)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRemoteUserEnterRoom(string userId)
|
public void onRemoteUserEnterRoom(string userId)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRemoteUserLeaveRoom(string userId, int reason)
|
public void onRemoteUserLeaveRoom(string userId, int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScreenCaptureCovered()
|
public void onScreenCaptureCovered()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScreenCapturePaused(int reason)
|
public void onScreenCapturePaused(int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScreenCaptureResumed(int reason)
|
public void onScreenCaptureResumed(int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScreenCaptureStarted()
|
public void onScreenCaptureStarted()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onScreenCaptureStoped(int reason)
|
public void onScreenCaptureStoped(int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSendFirstLocalAudioFrame()
|
public void onSendFirstLocalAudioFrame()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSendFirstLocalVideoFrame(TRTCVideoStreamType streamType)
|
public void onSendFirstLocalVideoFrame(TRTCVideoStreamType streamType)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSetMixTranscodingConfig(int errCode, string errMsg)
|
public void onSetMixTranscodingConfig(int errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSpeedTest(TRTCSpeedTestResult currentResult, uint finishedCount, uint totalCount)
|
public void onSpeedTest(TRTCSpeedTestResult currentResult, uint finishedCount, uint totalCount)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartPublishCDNStream(int errCode, string errMsg)
|
public void onStartPublishCDNStream(int errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStartPublishing(int errCode, string errMsg)
|
public void onStartPublishing(int errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStatistics(TRTCStatistics statis)
|
public void onStatistics(TRTCStatistics statis)
|
||||||
|
@ -190,72 +205,72 @@ namespace JianGongYun.TRTC.Utils
|
||||||
|
|
||||||
public void onStopPublishCDNStream(int errCode, string errMsg)
|
public void onStopPublishCDNStream(int errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onStopPublishing(int errCode, string errMsg)
|
public void onStopPublishing(int errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSwitchRole(TXLiteAVError errCode, string errMsg)
|
public void onSwitchRole(TXLiteAVError errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSwitchRoom(TXLiteAVError errCode, string errMsg)
|
public void onSwitchRoom(TXLiteAVError errCode, string errMsg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestMicVolume(uint volume)
|
public void onTestMicVolume(uint volume)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTestSpeakerVolume(uint volume)
|
public void onTestSpeakerVolume(uint volume)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onTryToReconnect()
|
public void onTryToReconnect()
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserAudioAvailable(string userId, bool available)
|
public void onUserAudioAvailable(string userId, bool available)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserEnter(string userId)
|
public void onUserEnter(string userId)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserExit(string userId, int reason)
|
public void onUserExit(string userId, int reason)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserSubStreamAvailable(string userId, bool available)
|
public void onUserSubStreamAvailable(string userId, bool available)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserVideoAvailable(string userId, bool available)
|
public void onUserVideoAvailable(string userId, bool available)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onUserVoiceVolume(TRTCVolumeInfo[] userVolumes, uint userVolumesCount, uint totalVolume)
|
public void onUserVoiceVolume(TRTCVolumeInfo[] userVolumes, uint userVolumesCount, uint totalVolume)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onWarning(TXLiteAVWarning warningCode, string warningMsg, IntPtr arg)
|
public void onWarning(TXLiteAVWarning warningCode, string warningMsg, IntPtr arg)
|
||||||
{
|
{
|
||||||
StackTrace trace = new StackTrace(true);StackFrame frame = trace.GetFrame(1);var method = frame.GetMethod();Console.WriteLine(method.Name);
|
StackTrace trace = new StackTrace(true); StackFrame frame = trace.GetFrame(1); var method = frame.GetMethod(); Console.WriteLine(method.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace JianGongYun.TRTC
|
||||||
bool? nullable = (bool?)value;
|
bool? nullable = (bool?)value;
|
||||||
flag = nullable.HasValue ? nullable.Value : false;
|
flag = nullable.HasValue ? nullable.Value : false;
|
||||||
}
|
}
|
||||||
return (flag ? Visibility.Hidden : Visibility.Visible);
|
return (flag ? Visibility.Collapsed : Visibility.Visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|
|
@ -73,6 +73,44 @@ namespace JianGongYun.TRTC.ViewModels
|
||||||
return _IsLive;
|
return _IsLive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// ws是否连接
|
||||||
|
/// </summary>
|
||||||
|
private bool _WSConneced = false;
|
||||||
|
public bool WSConneced
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_WSConneced = value;
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("WSConneced"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _WSConneced;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// TRTC是否连接
|
||||||
|
/// </summary>
|
||||||
|
private bool _TRTCConneced = false;
|
||||||
|
public bool TRTCConneced
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_TRTCConneced = value;
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("TRTCConneced"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _TRTCConneced;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public LiveWindowViewModel()
|
public LiveWindowViewModel()
|
||||||
{
|
{
|
||||||
|
@ -215,6 +253,7 @@ namespace JianGongYun.TRTC.ViewModels
|
||||||
if (PropertyChanged != null)
|
if (PropertyChanged != null)
|
||||||
{
|
{
|
||||||
PropertyChanged(this, new PropertyChangedEventArgs("MicMute"));
|
PropertyChanged(this, new PropertyChangedEventArgs("MicMute"));
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("SoundTip"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get
|
get
|
||||||
|
@ -222,6 +261,53 @@ namespace JianGongYun.TRTC.ViewModels
|
||||||
return _MicMute;
|
return _MicMute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 系统音静音
|
||||||
|
/// </summary>
|
||||||
|
private bool _SysMute = false;
|
||||||
|
public bool SysMute
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_SysMute = value;
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("SysMute"));
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("SoundTip"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _SysMute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 声音提示
|
||||||
|
/// </summary>
|
||||||
|
private string _SoundTip;
|
||||||
|
public string SoundTip
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!SysMute && !MicMute)
|
||||||
|
{
|
||||||
|
_SoundTip = "仅开启声音";
|
||||||
|
}
|
||||||
|
else if (SysMute && !MicMute)
|
||||||
|
{
|
||||||
|
_SoundTip = "仅开启麦克风";
|
||||||
|
}
|
||||||
|
else if (!SysMute && MicMute)
|
||||||
|
{
|
||||||
|
_SoundTip = "仅开启系统音";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_SoundTip = "所有设备被关闭";
|
||||||
|
}
|
||||||
|
return _SoundTip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private ObservableCollection<TRTCScreenEntity> _LiveScreens = new ObservableCollection<TRTCScreenEntity>();
|
private ObservableCollection<TRTCScreenEntity> _LiveScreens = new ObservableCollection<TRTCScreenEntity>();
|
||||||
|
|
|
@ -173,11 +173,18 @@ namespace JianGongYun.TRTC.ViewModels
|
||||||
if (_AudioSource == "1")//只采集麦克风,关闭系统音采集
|
if (_AudioSource == "1")//只采集麦克风,关闭系统音采集
|
||||||
{
|
{
|
||||||
ShowSytemGatherSlider = Visibility.Collapsed;
|
ShowSytemGatherSlider = Visibility.Collapsed;
|
||||||
|
ShowMicSetting = Visibility.Visible;
|
||||||
//LiveClassroom.lTRTCCloud.stopSystemAudioLoopback();
|
//LiveClassroom.lTRTCCloud.stopSystemAudioLoopback();
|
||||||
}
|
}
|
||||||
else if (_AudioSource == "2" || _AudioSource == "3")//麦和系统音,开启采集系统音
|
else if (_AudioSource == "2")//只显示系统音
|
||||||
{
|
{
|
||||||
ShowSytemGatherSlider = Visibility.Visible;
|
ShowSytemGatherSlider = Visibility.Visible;
|
||||||
|
ShowMicSetting = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
else if (_AudioSource == "3")//麦和系统音,开启采集系统音
|
||||||
|
{
|
||||||
|
ShowSytemGatherSlider = Visibility.Visible;
|
||||||
|
ShowMicSetting = Visibility.Visible;
|
||||||
//LiveClassroom.lTRTCCloud.startSystemAudioLoopback(null);
|
//LiveClassroom.lTRTCCloud.startSystemAudioLoopback(null);
|
||||||
}
|
}
|
||||||
if (PropertyChanged != null)
|
if (PropertyChanged != null)
|
||||||
|
@ -214,6 +221,33 @@ namespace JianGongYun.TRTC.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 是否显示系统采集滑动条
|
||||||
|
/// </summary>
|
||||||
|
private Visibility _ShowMicSetting = Visibility.Collapsed;
|
||||||
|
public Visibility ShowMicSetting
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (AudioSource == "1" || AudioSource == "3")
|
||||||
|
{
|
||||||
|
_ShowMicSetting = Visibility.Visible;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_ShowMicSetting = Visibility.Collapsed;
|
||||||
|
}
|
||||||
|
return _ShowMicSetting;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_ShowMicSetting = value;
|
||||||
|
if (PropertyChanged != null)
|
||||||
|
{
|
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs("ShowMicSetting"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 系统采集音量
|
/// 系统采集音量
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<Geometry x:Key="Icon_Camera">M512 85.33312C323.499138 85.33312 170.66752 238.164738 170.66752 426.6656s152.831618 341.33248 341.33248 341.33248 341.33248-152.831618 341.33248-341.33248S700.500862 85.33312 512 85.33312zM85.3344 426.6656C85.3344 191.032411 276.366811 0 512 0c235.661633 0 426.6656 191.032411 426.6656 426.6656 0 235.661633-191.003967 426.6656-426.6656 426.6656-235.633189 0-426.6656-191.003967-426.6656-426.6656z m127.99968 554.66528A42.66656 42.66656 0 0 1 256.00064 938.66432h511.99872a42.66656 42.66656 0 1 1 0 85.33312H256.00064a42.66656 42.66656 0 0 1-42.66656-42.66656z M459.776131 775.166062a42.239894 42.239894 0 0 1 19.114618 56.888747l-85.560675 169.642242a42.951004 42.951004 0 0 1-56.774969 17.806178 42.239894 42.239894 0 0 1-19.71195-55.722527l85.560675-169.642243a42.951004 42.951004 0 0 1 57.372301-18.972397z m132.892112 0a42.239894 42.239894 0 0 0-19.114619 56.888747l85.560675 169.642242a42.951004 42.951004 0 0 0 56.774969 17.806178 42.239894 42.239894 0 0 0 19.711951-55.722527l-85.560675-169.642243a42.951004 42.951004 0 0 0-57.372301-18.972397zM526.222187 321.136975c-61.439846 0-111.2175 49.350988-111.2175 110.250391 0 60.927848 49.777653 110.278835 111.2175 110.278835s111.2175-49.350988 111.217499-110.278835c0-60.870959-49.777653-110.250391-111.217499-110.250391z m-196.806619 110.250391c0-107.747286 88.120669-195.099957 196.806619-195.099957 108.685951 0 196.806619 87.352671 196.806619 195.128401 0 107.747286-88.120669 195.099957-196.806619 195.099957-108.685951 0-196.806619-87.352671-196.806619-195.128401zM526.222187 28.444373c23.60883 0 42.780337 19.000841 42.780337 42.410561v63.630063c0 23.409719-19.143063 42.382116-42.780337 42.382116-23.60883 0-42.780337-18.972397-42.780338-42.382116V70.82649c0-23.409719 19.143063-42.410561 42.780338-42.410561z</Geometry>
|
<Geometry x:Key="Icon_Camera">M512 85.33312C323.499138 85.33312 170.66752 238.164738 170.66752 426.6656s152.831618 341.33248 341.33248 341.33248 341.33248-152.831618 341.33248-341.33248S700.500862 85.33312 512 85.33312zM85.3344 426.6656C85.3344 191.032411 276.366811 0 512 0c235.661633 0 426.6656 191.032411 426.6656 426.6656 0 235.661633-191.003967 426.6656-426.6656 426.6656-235.633189 0-426.6656-191.003967-426.6656-426.6656z m127.99968 554.66528A42.66656 42.66656 0 0 1 256.00064 938.66432h511.99872a42.66656 42.66656 0 1 1 0 85.33312H256.00064a42.66656 42.66656 0 0 1-42.66656-42.66656z M459.776131 775.166062a42.239894 42.239894 0 0 1 19.114618 56.888747l-85.560675 169.642242a42.951004 42.951004 0 0 1-56.774969 17.806178 42.239894 42.239894 0 0 1-19.71195-55.722527l85.560675-169.642243a42.951004 42.951004 0 0 1 57.372301-18.972397z m132.892112 0a42.239894 42.239894 0 0 0-19.114619 56.888747l85.560675 169.642242a42.951004 42.951004 0 0 0 56.774969 17.806178 42.239894 42.239894 0 0 0 19.711951-55.722527l-85.560675-169.642243a42.951004 42.951004 0 0 0-57.372301-18.972397zM526.222187 321.136975c-61.439846 0-111.2175 49.350988-111.2175 110.250391 0 60.927848 49.777653 110.278835 111.2175 110.278835s111.2175-49.350988 111.217499-110.278835c0-60.870959-49.777653-110.250391-111.217499-110.250391z m-196.806619 110.250391c0-107.747286 88.120669-195.099957 196.806619-195.099957 108.685951 0 196.806619 87.352671 196.806619 195.128401 0 107.747286-88.120669 195.099957-196.806619 195.099957-108.685951 0-196.806619-87.352671-196.806619-195.128401zM526.222187 28.444373c23.60883 0 42.780337 19.000841 42.780337 42.410561v63.630063c0 23.409719-19.143063 42.382116-42.780337 42.382116-23.60883 0-42.780337-18.972397-42.780338-42.382116V70.82649c0-23.409719 19.143063-42.410561 42.780338-42.410561z</Geometry>
|
||||||
<Geometry x:Key="Icon_Screen">M864 159.872L160 160c-17.696 0-32 14.176-32 31.872v448a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32v-448a32 32 0 0 0-32-32zM864 640H160V191.872h704V640z M928 32H96a96 96 0 0 0-96 96v640a95.904 95.904 0 0 0 95.68 95.936H416v38.944l-199.744 25.952A31.968 31.968 0 0 0 224 991.872h576a32 32 0 0 0 7.744-63.072L608 902.88v-38.944h320.32A95.904 95.904 0 0 0 1024 768V128a96 96 0 0 0-96-96z m32 736c0 17.632-14.368 32-32 32H96c-17.664 0-32-14.368-32-32V128a32 32 0 0 1 32-32h832c17.632 0 32 14.336 32 32v640z</Geometry>
|
<Geometry x:Key="Icon_Screen">M864 159.872L160 160c-17.696 0-32 14.176-32 31.872v448a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32v-448a32 32 0 0 0-32-32zM864 640H160V191.872h704V640z M928 32H96a96 96 0 0 0-96 96v640a95.904 95.904 0 0 0 95.68 95.936H416v38.944l-199.744 25.952A31.968 31.968 0 0 0 224 991.872h576a32 32 0 0 0 7.744-63.072L608 902.88v-38.944h320.32A95.904 95.904 0 0 0 1024 768V128a96 96 0 0 0-96-96z m32 736c0 17.632-14.368 32-32 32H96c-17.664 0-32-14.368-32-32V128a32 32 0 0 1 32-32h832c17.632 0 32 14.336 32 32v640z</Geometry>
|
||||||
<Geometry x:Key="Icon_Mic">M486.4 972.8v-128.9728A332.8 332.8 0 0 1 179.2 512a25.6 25.6 0 0 1 51.2 0 281.6 281.6 0 0 0 563.2 0 25.6 25.6 0 1 1 51.2 0 332.8 332.8 0 0 1-307.2 331.8272V972.8h153.6a25.6 25.6 0 1 1 0 51.2h-358.4a25.6 25.6 0 1 1 0-51.2h153.6zM512 51.2a153.6 153.6 0 0 0-153.6 153.6v307.2a153.6 153.6 0 0 0 307.2 0V204.8a153.6 153.6 0 0 0-153.6-153.6z m0-51.2a204.8 204.8 0 0 1 204.8 204.8v307.2a204.8 204.8 0 1 1-409.6 0V204.8a204.8 204.8 0 0 1 204.8-204.8z</Geometry>
|
<Geometry x:Key="Icon_Mic">M486.4 972.8v-128.9728A332.8 332.8 0 0 1 179.2 512a25.6 25.6 0 0 1 51.2 0 281.6 281.6 0 0 0 563.2 0 25.6 25.6 0 1 1 51.2 0 332.8 332.8 0 0 1-307.2 331.8272V972.8h153.6a25.6 25.6 0 1 1 0 51.2h-358.4a25.6 25.6 0 1 1 0-51.2h153.6zM512 51.2a153.6 153.6 0 0 0-153.6 153.6v307.2a153.6 153.6 0 0 0 307.2 0V204.8a153.6 153.6 0 0 0-153.6-153.6z m0-51.2a204.8 204.8 0 0 1 204.8 204.8v307.2a204.8 204.8 0 1 1-409.6 0V204.8a204.8 204.8 0 0 1 204.8-204.8z</Geometry>
|
||||||
|
<Geometry x:Key="Icon_SysSound">M585.955556 896c-9.197037 0-18.299259-2.74963-26.168889-8.248889l-288.237037-202.145185h-101.451852c-23.22963 0-42.097778-18.583704-42.097778-41.528889V379.922963c0-22.85037 18.868148-41.528889 42.097778-41.528889h101.451852l288.237037-202.145185c14.032593-9.765926 32.142222-10.998519 47.312592-3.128889 14.885926 7.68 24.082963 22.85037 24.082963 39.348148v678.874074c0 16.592593-9.197037 31.668148-24.082963 39.348148-6.637037 3.602963-13.937778 5.30963-21.143703 5.30963zM170.666667 642.939259h114.346666l299.330371 209.92c0.948148 0.663704 1.991111 0.758519 3.128889 0.18963 1.137778-0.568889 1.137778-1.232593 1.137777-1.517037V172.562963c0-0.284444 0-0.948148-1.137777-1.517037-1.137778-0.568889-2.180741-0.474074-3.128889 0.18963L285.013333 381.060741H170.666667v261.878518zM757.57037 758.423704c-6.637037 0-13.179259-3.128889-17.351111-8.912593-6.826667-9.576296-4.645926-22.945185 4.930371-29.771852C812.847407 671.194074 853.333333 593.351111 853.333333 511.81037s-40.391111-159.194074-107.994074-207.834074c-9.576296-6.921481-11.757037-20.195556-4.835555-29.771852 6.921481-9.576296 20.195556-11.757037 29.771852-4.835555 38.115556 27.401481 69.688889 63.525926 91.401481 104.391111 22.471111 42.382222 34.322963 90.074074 34.322963 138.05037 0 48.071111-11.851852 95.857778-34.417778 138.24-21.712593 40.96-53.380741 77.084444-91.591111 104.485926-3.792593 2.56-8.059259 3.887407-12.420741 3.887408z M701.345185 703.715556c-7.016296 0-13.937778-3.508148-18.014815-9.860741-6.352593-9.955556-3.413333-23.134815 6.542223-29.487408 53.285926-33.848889 85.143704-90.927407 85.143703-152.651851 0-61.534815-31.762963-118.613333-84.859259-152.462223-9.955556-6.352593-12.894815-19.531852-6.542222-29.487407 6.352593-9.955556 19.531852-12.894815 29.487407-6.542222 65.517037 41.813333 104.580741 112.260741 104.580741 188.491852 0 76.325926-39.253333 146.868148-104.96 188.681481-3.508148 2.275556-7.49037 3.318519-11.377778 3.318519z</Geometry>
|
||||||
<Geometry x:Key="Icon_User">M511.626 1.896C229.572 1.896 0.927 230.541 0.927 512.595c0 282.055 228.645 510.699 510.699 510.699s510.698-228.645 510.698-510.699S793.68 1.896 511.626 1.896z m0 69.641c243.606 0 441.058 197.474 441.058 441.058 0 87.347-25.392 168.762-69.194 237.271-73.419-77.609-170.944-132.204-280.597-151.829 70.004-33.755 118.404-105.164 118.404-188.066 0-115.388-93.535-208.922-208.923-208.922S303.452 294.583 303.452 409.97c0 82.902 48.399 154.311 118.403 188.066-110.093 19.704-207.96 74.661-281.479 152.77-44.177-68.704-69.808-150.465-69.808-238.211 0-243.584 197.496-441.058 441.058-441.058z</Geometry>
|
<Geometry x:Key="Icon_User">M511.626 1.896C229.572 1.896 0.927 230.541 0.927 512.595c0 282.055 228.645 510.699 510.699 510.699s510.698-228.645 510.698-510.699S793.68 1.896 511.626 1.896z m0 69.641c243.606 0 441.058 197.474 441.058 441.058 0 87.347-25.392 168.762-69.194 237.271-73.419-77.609-170.944-132.204-280.597-151.829 70.004-33.755 118.404-105.164 118.404-188.066 0-115.388-93.535-208.922-208.923-208.922S303.452 294.583 303.452 409.97c0 82.902 48.399 154.311 118.403 188.066-110.093 19.704-207.96 74.661-281.479 152.77-44.177-68.704-69.808-150.465-69.808-238.211 0-243.584 197.496-441.058 441.058-441.058z</Geometry>
|
||||||
<Geometry x:Key="Icon_ChangeScreen">M447.5904 819.1488H166.4a89.6 89.6 0 0 1-89.6-89.4976V166.4c0-49.3568 40.192-89.5488 89.6-89.5488h563.2c49.4592 0 89.6512 40.192 89.6512 89.5488v281.6H896v-281.6A166.5536 166.5536 0 0 0 729.6 0h-563.2A166.5536 166.5536 0 0 0 0 166.4v563.2512A166.656 166.656 0 0 0 166.4 896h281.1904v-76.8512z M947.2 238.5408V857.6c0 49.408-40.192 89.6-89.6 89.6H242.7904V1024H857.6A166.6048 166.6048 0 0 0 1024 857.6V238.5408h-76.8z M577.8944 813.8752h235.9808v-236.032h-76.8v104.96l-395.776-395.8784h104.9088V210.176H210.1248v235.9808h76.8V341.248l395.9296 395.8784h-104.96z</Geometry>
|
<Geometry x:Key="Icon_ChangeScreen">M447.5904 819.1488H166.4a89.6 89.6 0 0 1-89.6-89.4976V166.4c0-49.3568 40.192-89.5488 89.6-89.5488h563.2c49.4592 0 89.6512 40.192 89.6512 89.5488v281.6H896v-281.6A166.5536 166.5536 0 0 0 729.6 0h-563.2A166.5536 166.5536 0 0 0 0 166.4v563.2512A166.656 166.656 0 0 0 166.4 896h281.1904v-76.8512z M947.2 238.5408V857.6c0 49.408-40.192 89.6-89.6 89.6H242.7904V1024H857.6A166.6048 166.6048 0 0 0 1024 857.6V238.5408h-76.8z M577.8944 813.8752h235.9808v-236.032h-76.8v104.96l-395.776-395.8784h104.9088V210.176H210.1248v235.9808h76.8V341.248l395.9296 395.8784h-104.96z</Geometry>
|
||||||
<Geometry x:Key="Icon_Ban">M2.896 921.614L924.656 0l102.385 102.386L105.354 1024z</Geometry>
|
<Geometry x:Key="Icon_Ban">M2.896 921.614L924.656 0l102.385 102.386L105.354 1024z</Geometry>
|
||||||
|
@ -61,11 +62,13 @@
|
||||||
<TextBlock FontSize="14" Foreground="#3d7cf9" Text="{Binding StudentCount,Mode=OneWay}"></TextBlock>
|
<TextBlock FontSize="14" Foreground="#3d7cf9" Text="{Binding StudentCount,Mode=OneWay}"></TextBlock>
|
||||||
<TextBlock FontSize="14" Padding="3 0 0 0" Foreground="#bbbbbb" Text="人"></TextBlock>
|
<TextBlock FontSize="14" Padding="3 0 0 0" Foreground="#bbbbbb" Text="人"></TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Metro:AduFlatButton Content="开始直播" Click="StartLive_Click" Tag="True" Canvas.Bottom="13" Canvas.Right="25" Visibility="{Binding IsLive, Converter={StaticResource UnVisibilityOfBool}}"></Metro:AduFlatButton>
|
<Metro:AduFlatButton Content="开始直播" IsEnabled="{Binding TRTCConneced}" Click="StartLive_Click" Tag="True" Canvas.Bottom="13" Canvas.Right="25" Visibility="{Binding IsLive, Converter={StaticResource UnVisibilityOfBool}}"></Metro:AduFlatButton>
|
||||||
<Metro:AduFlatButton Content="结束直播" x:Name="stoplive" Click="StartLive_Click" Tag="False" Type="error" Canvas.Bottom="13" Canvas.Right="25" Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}"></Metro:AduFlatButton>
|
<Metro:AduFlatButton Content="结束直播" x:Name="stoplive" Click="StartLive_Click" Tag="False" Type="error" Canvas.Bottom="13" Canvas.Right="25" Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}"></Metro:AduFlatButton>
|
||||||
<StackPanel Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}" Orientation="Horizontal" Canvas.Bottom="20" Canvas.Right="150">
|
<StackPanel Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}" Orientation="Horizontal" Canvas.Bottom="20" Canvas.Right="150">
|
||||||
<Ellipse VerticalAlignment="Center" Width="10" Fill="#00cc66" Height="10"></Ellipse>
|
<Ellipse Visibility="{Binding TRTCConneced, Converter={StaticResource VisibilityOfBool}}" VerticalAlignment="Center" Width="10" Fill="#00cc66" Height="10"></Ellipse>
|
||||||
<TextBlock FontSize="15" Foreground="White" Margin="7 0 0 0">直播中</TextBlock>
|
<Ellipse Visibility="{Binding TRTCConneced, Converter={StaticResource UnVisibilityOfBool}}" VerticalAlignment="Center" Width="10" Fill="Red" Height="10"></Ellipse>
|
||||||
|
<TextBlock Visibility="{Binding TRTCConneced, Converter={StaticResource VisibilityOfBool}}" FontSize="15" Foreground="White" Margin="7 0 0 0">直播中</TextBlock>
|
||||||
|
<TextBlock Visibility="{Binding TRTCConneced, Converter={StaticResource UnVisibilityOfBool}}" FontSize="15" Foreground="Red" Margin="7 0 0 0">重连中</TextBlock>
|
||||||
<TextBlock FontSize="15" Foreground="White" Margin="7 0 0 0" Text="{Binding LiveTimeCount}"></TextBlock>
|
<TextBlock FontSize="15" Foreground="White" Margin="7 0 0 0" Text="{Binding LiveTimeCount}"></TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
@ -127,6 +130,12 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
<Grid Visibility="{Binding WSConneced, Converter={StaticResource UnVisibilityOfBool}}" Canvas.Left="0" Canvas.Top="0" Height="{Binding ElementName=ChatWrap,Path=ActualHeight}" Width="{Binding ElementName=ChatWrap,Path=ActualWidth}" Background="#dd2a2b30">
|
||||||
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Metro:AduLoading Margin="0,0,0,0" x:Name="ChatConnIcon" SpeedRatio="1" Foreground="White" Type="Lines" IsActived="True" Height="30"/>
|
||||||
|
<!--<Label FontSize="14" Foreground="#bbbbbb">连接中</Label>-->
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
<!--下方教程面板-->
|
<!--下方教程面板-->
|
||||||
<Canvas DockPanel.Dock="Bottom" Height="30" Background="#2a2b30">
|
<Canvas DockPanel.Dock="Bottom" Height="30" Background="#2a2b30">
|
||||||
|
@ -144,8 +153,12 @@
|
||||||
</Button>
|
</Button>
|
||||||
<StackPanel Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}" Orientation="Horizontal" Canvas.Right="27" Canvas.Top="10" Height="50">
|
<StackPanel Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}" Orientation="Horizontal" Canvas.Right="27" Canvas.Top="10" Height="50">
|
||||||
<Canvas HorizontalAlignment="Right" Height="50" Width="50">
|
<Canvas HorizontalAlignment="Right" Height="50" Width="50">
|
||||||
<Metro:AduSysButton ToolTip="禁用/启用声音" Click="SetMute_Click" Foreground="#aaaaaa" IconHeight="25" IconWidth="18" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Mic}" Content="" />
|
<Metro:AduSysButton ToolTip="禁用/启用麦克风" Click="SetMute_Click" Tag="mic" Foreground="#aaaaaa" IconHeight="25" IconWidth="18" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Mic}" Content="" />
|
||||||
<Metro:AduSysButton ToolTip="禁用/启用声音" Click="SetMute_Click" Visibility="{Binding MicMute, Converter={StaticResource VisibilityOfBool}}" Foreground="#aaaaaa" IconHeight="25" IconWidth="25" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Ban}" Content="" />
|
<Metro:AduSysButton ToolTip="禁用/启用麦克风" Click="SetMute_Click" Tag="mic" Visibility="{Binding MicMute, Converter={StaticResource VisibilityOfBool}}" Foreground="#aaaaaa" IconHeight="25" IconWidth="25" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Ban}" Content="" />
|
||||||
|
</Canvas>
|
||||||
|
<Canvas HorizontalAlignment="Right" Height="50" Width="50">
|
||||||
|
<Metro:AduSysButton ToolTip="禁用/启用系统音" Click="SetMute_Click" Tag="sys" Foreground="#aaaaaa" IconHeight="25" IconWidth="23" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_SysSound}" Content="" />
|
||||||
|
<Metro:AduSysButton ToolTip="禁用/启用系统音" Click="SetMute_Click" Tag="sys" Visibility="{Binding SysMute, Converter={StaticResource VisibilityOfBool}}" Foreground="#aaaaaa" IconHeight="25" IconWidth="25" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Ban}" Content="" />
|
||||||
</Canvas>
|
</Canvas>
|
||||||
<Canvas HorizontalAlignment="Right" Height="50" Width="50">
|
<Canvas HorizontalAlignment="Right" Height="50" Width="50">
|
||||||
<Metro:AduSysButton ToolTip="禁用/启用摄像头" Click="SetCamera_Click" Foreground="#aaaaaa" IconHeight="25" IconWidth="20" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Camera}" Content="" />
|
<Metro:AduSysButton ToolTip="禁用/启用摄像头" Click="SetCamera_Click" Foreground="#aaaaaa" IconHeight="25" IconWidth="20" CornerRadius="6" Height="50" Width="50" Icon="{StaticResource Icon_Camera}" Content="" />
|
||||||
|
@ -230,12 +243,12 @@
|
||||||
<!--直播中-->
|
<!--直播中-->
|
||||||
<Grid Canvas.Top="0" Canvas.Left="0" Height="{Binding ElementName=CusContent,Path=ActualHeight}" Width="{Binding ElementName=CusContent,Path=ActualWidth}" Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}">
|
<Grid Canvas.Top="0" Canvas.Left="0" Height="{Binding ElementName=CusContent,Path=ActualHeight}" Width="{Binding ElementName=CusContent,Path=ActualWidth}" Visibility="{Binding IsLive, Converter={StaticResource VisibilityOfBool}}">
|
||||||
<Canvas x:Name="AfterLivePanel">
|
<Canvas x:Name="AfterLivePanel">
|
||||||
<Grid Visibility="{Binding MicMute, Converter={StaticResource UnVisibilityOfBool}}" Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0">
|
<Grid Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0">
|
||||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#aaaaaa" FontSize="14" >仅开启声音</TextBlock>
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#aaaaaa" FontSize="14" Text="{Binding SoundTip,Mode=OneWay}" ></TextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid Visibility="{Binding MicMute, Converter={StaticResource VisibilityOfBool}}" Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0">
|
<!--<Grid Visibility="{Binding MicMute, Converter={StaticResource VisibilityOfBool}}" Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0">
|
||||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#aaaaaa" FontSize="14" >所有设备被关闭</TextBlock>
|
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#aaaaaa" FontSize="14" >所有设备被关闭</TextBlock>
|
||||||
</Grid>
|
</Grid>-->
|
||||||
<!--屏幕预览容器-->
|
<!--屏幕预览容器-->
|
||||||
<Grid x:Name="AfterLiveSubViewWrap" Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0"></Grid>
|
<Grid x:Name="AfterLiveSubViewWrap" Width="{Binding ElementName=AfterLivePanel,Path=ActualWidth}" Height="{Binding ElementName=AfterLivePanel,Path=ActualHeight}" Canvas.Top="0" Canvas.Left="0"></Grid>
|
||||||
<!--摄像头预览容器-->
|
<!--摄像头预览容器-->
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace JianGongYun.TRTC.Windows
|
||||||
var time = data["extend"]["time"].ToString();
|
var time = data["extend"]["time"].ToString();
|
||||||
this.Dispatcher.Invoke(new Action(() =>
|
this.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
if (LiveWindowViewModel.Chats.Count > 520)
|
if (LiveWindowViewModel.Chats.Count > 200)
|
||||||
{
|
{
|
||||||
LiveWindowViewModel.Chats.RemoveAt(0);
|
LiveWindowViewModel.Chats.RemoveAt(0);
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ namespace JianGongYun.TRTC.Windows
|
||||||
Rad2.Foreground = color;
|
Rad2.Foreground = color;
|
||||||
Rad3.Foreground = color;
|
Rad3.Foreground = color;
|
||||||
Rad4.Foreground = color;
|
Rad4.Foreground = color;
|
||||||
|
ChatConnIcon.Foreground = new SolidColorBrush(Colors.White);
|
||||||
if (LiveWindowViewModel.IsLive)
|
if (LiveWindowViewModel.IsLive)
|
||||||
{
|
{
|
||||||
LiveClassroom.PauseAllView(false);//切前台启动实时预览渲染
|
LiveClassroom.PauseAllView(false);//切前台启动实时预览渲染
|
||||||
|
@ -245,7 +246,10 @@ namespace JianGongYun.TRTC.Windows
|
||||||
|
|
||||||
if (onEnd == null)
|
if (onEnd == null)
|
||||||
{
|
{
|
||||||
this.Close();
|
this.Dispatcher.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
this.Close();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
//LiveClassroom.CallerWindow.Show();//还原调用者窗口
|
//LiveClassroom.CallerWindow.Show();//还原调用者窗口
|
||||||
}
|
}
|
||||||
|
@ -379,11 +383,13 @@ namespace JianGongYun.TRTC.Windows
|
||||||
|
|
||||||
private void SetMute_Click(object sender, RoutedEventArgs e)
|
private void SetMute_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
LiveClassroom.SetMicMute(null);
|
var btn = sender as AduSysButton;
|
||||||
|
var tag = btn.Tag.ToString();
|
||||||
|
LiveClassroom.SetMicMute(null, tag);
|
||||||
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
||||||
{
|
{
|
||||||
Title = "提醒",
|
Title = "提醒",
|
||||||
Content = $"{(LiveWindowViewModel.MicMute ? "设置" : "取消")}静音成功"
|
Content = $"{(LiveWindowViewModel.MicMute ? "设置" : "取消")}{(tag == "mic" ? "麦克风" : "系统音")}静音成功"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:JianGongYun.TRTC.Windows"
|
xmlns:local="clr-namespace:JianGongYun.TRTC.Windows"
|
||||||
xmlns:System="clr-namespace:System;assembly=mscorlib"
|
xmlns:System="clr-namespace:System;assembly=mscorlib"
|
||||||
|
xmlns:Metro="clr-namespace:AduSkin.Controls.Metro;assembly=AduSkin"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
|
@ -58,6 +59,7 @@
|
||||||
|
|
||||||
<BooleanToVisibilityConverter x:Key="VisibilityOfBool" />
|
<BooleanToVisibilityConverter x:Key="VisibilityOfBool" />
|
||||||
<live:ChatItemBgConverter x:Key="BgByVal" />
|
<live:ChatItemBgConverter x:Key="BgByVal" />
|
||||||
|
<live:UnBooleanToVisibilityConverter x:Key="UnVisibilityOfBool" />
|
||||||
|
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
|
@ -72,8 +74,9 @@
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!--聊天版面-->
|
<!--聊天版面-->
|
||||||
<Grid Background="#01000000">
|
<Canvas x:Name="ChatWrap">
|
||||||
<DockPanel>
|
<Grid Canvas.Left="0" Canvas.Top="0" Background="#01000000" Height="{Binding ElementName=ChatWrap,Path=ActualHeight}" Width="{Binding ElementName=ChatWrap,Path=ActualWidth}">
|
||||||
|
<DockPanel>
|
||||||
<!--输入框-->
|
<!--输入框-->
|
||||||
<DockPanel Margin="{StaticResource fullfar}" DockPanel.Dock="Bottom" Height="{StaticResource ipth}">
|
<DockPanel Margin="{StaticResource fullfar}" DockPanel.Dock="Bottom" Height="{StaticResource ipth}">
|
||||||
<TextBox Background="{StaticResource itembg}" Height="{StaticResource ipth}" Padding="{StaticResource fullfar}" Foreground="White" Style="{StaticResource placeHolder}" PreviewKeyDown="TextBox_PreviewKeyDown" Tag="输入"></TextBox>
|
<TextBox Background="{StaticResource itembg}" Height="{StaticResource ipth}" Padding="{StaticResource fullfar}" Foreground="White" Style="{StaticResource placeHolder}" PreviewKeyDown="TextBox_PreviewKeyDown" Tag="输入"></TextBox>
|
||||||
|
@ -119,7 +122,14 @@
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</local:ScrollingListBox>
|
</local:ScrollingListBox>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid Visibility="{Binding WSConneced, Converter={StaticResource UnVisibilityOfBool}}" Canvas.Left="0" Canvas.Top="0" Height="{Binding ElementName=ChatWrap,Path=ActualHeight}" Width="{Binding ElementName=ChatWrap,Path=ActualWidth}" Background="#aa2a2b30">
|
||||||
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<Metro:AduLoading Margin="0,0,0,0" x:Name="ChatConnIcon" SpeedRatio="1" Foreground="White" Type="Lines" IsActived="True" Height="30"/>
|
||||||
|
<!--<Label FontSize="14" Foreground="#bbbbbb">连接中</Label>-->
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Canvas>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:JianGongYun.TRTC.Windows"
|
xmlns:local="clr-namespace:JianGongYun.TRTC.Windows"
|
||||||
|
xmlns:live="clr-namespace:JianGongYun.TRTC"
|
||||||
ShowInTaskbar="False"
|
ShowInTaskbar="False"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
AllowsTransparency="True"
|
AllowsTransparency="True"
|
||||||
|
@ -18,6 +19,10 @@
|
||||||
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
MouseLeftButtonDown="Window_MouseLeftButtonDown"
|
||||||
MouseLeftButtonUp="Window_MouseLeftButtonUp"
|
MouseLeftButtonUp="Window_MouseLeftButtonUp"
|
||||||
>
|
>
|
||||||
|
<Window.Resources>
|
||||||
|
<BooleanToVisibilityConverter x:Key="VisibilityOfBool" />
|
||||||
|
<live:UnBooleanToVisibilityConverter x:Key="UnVisibilityOfBool" />
|
||||||
|
</Window.Resources>
|
||||||
<Border Cursor="Hand" CornerRadius="0 0 15 15" Background="#aa000000">
|
<Border Cursor="Hand" CornerRadius="0 0 15 15" Background="#aa000000">
|
||||||
<DockPanel Margin="10 0" VerticalAlignment="Center">
|
<DockPanel Margin="10 0" VerticalAlignment="Center">
|
||||||
<StackPanel Orientation="Horizontal" Width="72" DockPanel.Dock="Right">
|
<StackPanel Orientation="Horizontal" Width="72" DockPanel.Dock="Right">
|
||||||
|
@ -37,8 +42,10 @@
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Width="130" Orientation="Horizontal" DockPanel.Dock="Right">
|
<StackPanel Width="130" Orientation="Horizontal" DockPanel.Dock="Right">
|
||||||
<Ellipse VerticalAlignment="Center" Width="12" Fill="#00cc66" Height="12"></Ellipse>
|
<Ellipse Visibility="{Binding TRTCConneced, Converter={StaticResource VisibilityOfBool}}" VerticalAlignment="Center" Width="12" Fill="#00cc66" Height="12"></Ellipse>
|
||||||
<TextBlock Margin="5 0 0 0" FontSize="13" Foreground="#00cc66">直播中</TextBlock>
|
<TextBlock Visibility="{Binding TRTCConneced, Converter={StaticResource VisibilityOfBool}}" Margin="5 0 0 0" FontSize="13" Foreground="#00cc66">直播中</TextBlock>
|
||||||
|
<Ellipse Visibility="{Binding TRTCConneced, Converter={StaticResource UnVisibilityOfBool}}" VerticalAlignment="Center" Width="12" Fill="Red" Height="12"></Ellipse>
|
||||||
|
<TextBlock Visibility="{Binding TRTCConneced, Converter={StaticResource UnVisibilityOfBool}}" Margin="5 0 0 0" FontSize="13" Foreground="Red">重连中</TextBlock>
|
||||||
<TextBlock Margin="5 0 0 0" FontSize="13" Foreground="White" Text="{Binding LiveTimeCount}"></TextBlock>
|
<TextBlock Margin="5 0 0 0" FontSize="13" Foreground="White" Text="{Binding LiveTimeCount}"></TextBlock>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
|
|
@ -32,15 +32,6 @@
|
||||||
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 摄像头</TextBlock>
|
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 摄像头</TextBlock>
|
||||||
<Metro:AduComboBox ItemsSource="{Binding CameraList,Mode=OneWay}" DisplayMemberPath="Text" SelectedValuePath="Id" SelectedValue="{Binding CurrentCamera,Mode=TwoWay}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}"></Metro:AduComboBox>
|
<Metro:AduComboBox ItemsSource="{Binding CameraList,Mode=OneWay}" DisplayMemberPath="Text" SelectedValuePath="Id" SelectedValue="{Binding CurrentCamera,Mode=TwoWay}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}"></Metro:AduComboBox>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<DockPanel Style="{StaticResource SettingItem}">
|
|
||||||
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 麦克风</TextBlock>
|
|
||||||
<Metro:AduFlatButton Content="检测麦克风" x:Name="MicTestBtn" Click="TestMic" Width="100" DockPanel.Dock="Right" Margin=" 11 0 10 0" Type="info" />
|
|
||||||
<Metro:AduComboBox ItemsSource="{Binding MicList,Mode=OneWay}" DisplayMemberPath="Text" SelectedValuePath="Id" SelectedValue="{Binding CurrentMic,Mode=TwoWay}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}"></Metro:AduComboBox>
|
|
||||||
</DockPanel>
|
|
||||||
<DockPanel Style="{StaticResource SettingItem}">
|
|
||||||
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 麦采集音量</TextBlock>
|
|
||||||
<Metro:AduFlatSilder x:Name="Slider1" DecreaseColor="#3e7fff" IncreaseColor="#aaaaaa" Maximum="100" Value="{Binding MicVolume}" Margin="0 0 10 0" Height="17"/>
|
|
||||||
</DockPanel>
|
|
||||||
<DockPanel Style="{StaticResource SettingItem}">
|
<DockPanel Style="{StaticResource SettingItem}">
|
||||||
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 音频来源</TextBlock>
|
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 音频来源</TextBlock>
|
||||||
<Metro:AduComboBox Margin="0 0 10 0" SelectedValuePath="Tag" SelectedValue="{Binding AudioSource}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}">
|
<Metro:AduComboBox Margin="0 0 10 0" SelectedValuePath="Tag" SelectedValue="{Binding AudioSource}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}">
|
||||||
|
@ -49,6 +40,15 @@
|
||||||
<ComboBoxItem Content="麦和系统声音" Tag="3" />
|
<ComboBoxItem Content="麦和系统声音" Tag="3" />
|
||||||
</Metro:AduComboBox>
|
</Metro:AduComboBox>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
<DockPanel Visibility="{Binding ShowMicSetting}" Style="{StaticResource SettingItem}">
|
||||||
|
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 麦克风</TextBlock>
|
||||||
|
<Metro:AduFlatButton Content="检测麦克风" x:Name="MicTestBtn" Click="TestMic" Width="100" DockPanel.Dock="Right" Margin=" 11 0 10 0" Type="info" />
|
||||||
|
<Metro:AduComboBox ItemsSource="{Binding MicList,Mode=OneWay}" DisplayMemberPath="Text" SelectedValuePath="Id" SelectedValue="{Binding CurrentMic,Mode=TwoWay}" ComBoxItemPanelBackground="{StaticResource ComboBoxBrush}"></Metro:AduComboBox>
|
||||||
|
</DockPanel>
|
||||||
|
<DockPanel Visibility="{Binding ShowMicSetting}" Style="{StaticResource SettingItem}">
|
||||||
|
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 麦采集音量</TextBlock>
|
||||||
|
<Metro:AduFlatSilder x:Name="Slider1" DecreaseColor="#3e7fff" IncreaseColor="#aaaaaa" Maximum="100" Value="{Binding MicVolume}" Margin="0 0 10 0" Height="17"/>
|
||||||
|
</DockPanel>
|
||||||
<DockPanel Visibility="{Binding ShowSytemGatherSlider}" Style="{StaticResource SettingItem}">
|
<DockPanel Visibility="{Binding ShowSytemGatherSlider}" Style="{StaticResource SettingItem}">
|
||||||
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 系统采集音量</TextBlock>
|
<TextBlock Style="{StaticResource SettingItemText}" DockPanel.Dock="Left"> 系统采集音量</TextBlock>
|
||||||
<Metro:AduFlatSilder x:Name="Slider2" DecreaseColor="#3e7fff" IncreaseColor="#aaaaaa" Maximum="100" Value="{Binding SytemGatherVolume}" Margin="0 0 10 0" Height="17"/>
|
<Metro:AduFlatSilder x:Name="Slider2" DecreaseColor="#3e7fff" IncreaseColor="#aaaaaa" Maximum="100" Value="{Binding SytemGatherVolume}" Margin="0 0 10 0" Height="17"/>
|
||||||
|
|
|
@ -14,20 +14,43 @@ namespace WSDemo
|
||||||
|
|
||||||
using (var client = new WebsocketClient(url))
|
using (var client = new WebsocketClient(url))
|
||||||
{
|
{
|
||||||
client.ReconnectTimeout = TimeSpan.FromSeconds(30);
|
client.ErrorReconnectTimeout = TimeSpan.FromSeconds(10);
|
||||||
client.ReconnectionHappened.Subscribe(info =>
|
client.ReconnectTimeout = TimeSpan.FromSeconds(10);
|
||||||
Console.WriteLine($"Reconnection happened, type: {info.Type}"));
|
client.ReconnectionHappened.Subscribe((info) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Reconnection happened, type: {info.Type}");
|
||||||
|
client.Send("{code:10000,nick:\"张三\",\"room\":\"push_1500\"}");
|
||||||
|
//if (!client.IsRunning)
|
||||||
|
//{
|
||||||
|
// client.Reconnect();
|
||||||
|
//}
|
||||||
|
});
|
||||||
|
client.DisconnectionHappened.Subscribe((info) =>
|
||||||
|
{
|
||||||
|
Console.WriteLine($"DisconnectionHappened happened, type: {info.Type}, {info.CloseStatusDescription}");
|
||||||
|
//if (!client.IsRunning)
|
||||||
|
//{
|
||||||
|
// client.Reconnect();
|
||||||
|
//}
|
||||||
|
});
|
||||||
|
|
||||||
client.MessageReceived.Subscribe(msg => Console.WriteLine($"Message received: {msg}"));
|
client.MessageReceived.Subscribe(msg => Console.WriteLine($"Message received: {msg}"));
|
||||||
client.StartOrFail();
|
client.Start();
|
||||||
|
|
||||||
Task.Run(() => client.Send("{code:10000,nick:\"张三\",\"room\":\"push_1500\"}"));
|
//Task.Run(() => client.Send("{code:10000,nick:\"张三\",\"room\":\"push_1500\"}"));
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
client.Send($"{{\"code\":10086,\"mess\":\"{Guid.NewGuid()}\",\"room\":\"push_1500\"}}");
|
try
|
||||||
client.Send("{code:10016}");
|
{
|
||||||
|
client.Send($"{{\"code\":10086,\"mess\":\"{Guid.NewGuid()}\",\"room\":\"push_1500\"}}");
|
||||||
|
client.Send("{code:10016}");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine(ex.Message);
|
||||||
|
}
|
||||||
Thread.Sleep(5000);
|
Thread.Sleep(5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue