This commit is contained in:
lxmou666 2021-02-27 22:47:36 +08:00
parent a012185146
commit 7ebfe8c272
8 changed files with 34 additions and 22 deletions

View File

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="SDKAppID" value="1400472092"/>
<add key="SDKAppKEY" value="75907eef24093acc1d2cc20ed1eb95c50cd6728c8f5e0d98b17c5180824eee78"/>
<add key="LIVEAppID" value="1302772646"/>
<add key="LIVEBizid" value="110962"/>
<add key="RoomId" value ="654657754"/>
<add key="WSUrl" value ="wss://web.cqjgjyw.cn/websocket"/>
</appSettings>
<appSettings>
<add key="SDKAppID" value="1400472092"/>
<add key="SDKAppKEY" value="75907eef24093acc1d2cc20ed1eb95c50cd6728c8f5e0d98b17c5180824eee78"/>
<add key="LIVEAppID" value="1302772646"/>
<add key="LIVEBizid" value="110962"/>
<add key="RoomId" value ="654657754"/>
<add key="WSUrl" value ="wss://web.cqjgjyw.cn/websocket"/>
<add key="ParamTip" value ="Startup Parameter Null"/>
</appSettings>
</configuration>

View File

@ -2,7 +2,7 @@
"profiles": {
"JianGongYun": {
"commandName": "Project",
"commandLineArgs": "sznykt://--classhead|测试课程1|--classsubhead|测试章节1|--teacherid|1234_5678|--teachername|王大锤|endtime|2022-02-25 11:11:11",
"commandLineArgs": "sznykt://--classhead|测试课程1|--classsubhead|测试章节1|--teacherid|1234_1500|--teachername|王大锤|endtime|2022-02-25 11:11:11",
"nativeDebugging": false
}
}

View File

@ -99,7 +99,8 @@ namespace JianGongYun.TRTC
CurrentClassroomEntity = classroomEntity;
CurrentLiveWindow = new LiveWindow();
liveWinMode = CurrentLiveWindow.DataContext as LiveWindowViewModel;
CurrentLiveWindow.Closed += CurrentLiveWindow_Closed;
CurrentLiveWindow.Closing += CurrentLiveWindow_Closed;
//CurrentLiveWindow.Closed += CurrentLiveWindow_Closed;
lTRTCCloud = ITRTCCloud.getTRTCShareInstance();//创建TRTC实例
lTRTCCloud.addCallback(TRTCCloudCallback);//注册回调
@ -777,22 +778,21 @@ namespace JianGongYun.TRTC
private static void CurrentLiveWindow_Closed(object sender, EventArgs e)
{
CurrentLiveWindow = null;
CurrentClassroomEntity = null;
StopMic();
StopVideoMain(CurrentLiveWindow.AfterLiveViewWrap);
StopVideoSub(CurrentLiveWindow.AfterLiveSubViewWrap);
Heartbeat.Stop();
WSClient.Stop(System.Net.WebSockets.WebSocketCloseStatus.NormalClosure, "end");
WSClient.Dispose();
WSClient = null;
Heartbeat = null;
lTXDeviceManager.Dispose();
lTXDeviceManager = null;
lTRTCCloud.exitRoom();
lTRTCCloud.removeCallback(TRTCCloudCallback);//注册回调
ITRTCCloud.destroyTRTCShareInstance();//销毁TRTC实例
lTRTCCloud.Dispose();
lTRTCCloud = null;
//if (CallerWindow == null)
//{
// //关闭程序
@ -800,6 +800,12 @@ namespace JianGongYun.TRTC
// return;
//}
//CallerWindow.Close();//直接关闭
CurrentLiveWindow = null;
CurrentClassroomEntity = null;
WSClient = null;
Heartbeat = null;
lTRTCCloud = null;
lTXDeviceManager = null;
Environment.Exit(0);
}

View File

@ -9,5 +9,9 @@ namespace JianGongYun.TRTC.Models
public string Body { get; set; }
public string Nick { get; set; }
public string Date { get; set; }
public string FullBody
{
get { return $"{Date} {Nick}{Body}"; }
}
}
}

View File

@ -7,7 +7,7 @@
xmlns:local="clr-namespace:JianGongYun.TRTC.Windows"
xmlns:live="clr-namespace:JianGongYun.TRTC"
mc:Ignorable="d"
Title="建工云课堂" MinWidth="1000" MinHeight="650"
Title="三只鸟云课堂" MinWidth="1000" MinHeight="650"
d:DesignHeight="1200" d:DesignWidth="1600"
BorderThickness="0" WindowStyle="None"
WindowStartupLocation="CenterOwner"

View File

@ -113,7 +113,7 @@
<!--自定义ListBox项样式-->
<DataTemplate>
<StackPanel>
<TextBlock Foreground="White" TextWrapping="Wrap" Text="{Binding Path=Body}">
<TextBlock Foreground="White" TextWrapping="Wrap" Text="{Binding Path=FullBody,Mode=OneWay}">
</TextBlock>
</StackPanel>
</DataTemplate>

View File

@ -28,6 +28,7 @@ namespace JianGongYun.Views
const string TEACHER_ID = "--teacherid";
const string TEACHER_NAME = "--teachername";
const string END_TIME = "endtime";
static string ParamTip { get { return ConfigurationManager.AppSettings[nameof(ParamTip)]; } }
public Login()
{
InitializeComponent();
@ -40,13 +41,13 @@ namespace JianGongYun.Views
var urltemps = Environment.GetCommandLineArgs();
if (urltemps.Length < 2)
{
errMsg = $"Startup Parameter Null";
errMsg = ParamTip;
goto Skip;
}
var first = urltemps[1];
if (!first.StartsWith("sznykt"))
{
errMsg = "Startup Parameter Error";
errMsg = ParamTip;
goto Skip;
}

View File

@ -21,12 +21,12 @@ namespace WSDemo
client.MessageReceived.Subscribe(msg => Console.WriteLine($"Message received: {msg}"));
client.StartOrFail();
Task.Run(() => client.Send("{code:10000,nick:\"张三\",\"room\":\"push_5678\"}"));
Task.Run(() => client.Send("{code:10000,nick:\"张三\",\"room\":\"push_1500\"}"));
Task.Run(() =>
{
while (true)
{
client.Send($"{{\"code\":10086,\"mess\":\"{Guid.NewGuid()}\",\"room\":\"push_5678\"}}");
client.Send($"{{\"code\":10086,\"mess\":\"{Guid.NewGuid()}\",\"room\":\"push_1500\"}}");
client.Send("{code:10016}");
Thread.Sleep(5000);
}