Browse Source

在原视频播放上面 修改成全屏覆盖

master
胡超1 1 year ago
parent
commit
075c87d832
  1. 31
      CPF_Cef/AksVideoPlayer.cs
  2. 2
      CPF_Cef/Common/WebSocketClientWithHeartbeat.cs
  3. 25
      CPF_Cef/MainModel.cs

31
CPF_Cef/AksVideoPlayer.cs

@ -24,13 +24,15 @@ namespace AksWebBrowser
{
Name = "player",
PresenterFor = this,
MarginTop = 50,
MarginTop = 750,
Size = SizeField.Fill,
Background = Color.Silver
Background = Color.Silver,
Height=600,
};
videoTitle = _videoTitle;
url = _url;
this.window = window;
window.Children.Add(mask);
window.Children.Add(this);
mask.TransitionValue(a => a.Background, "0,0,0,100", TimeSpan.FromSeconds(0.3), null, AnimateMode.Linear);
@ -47,10 +49,11 @@ namespace AksWebBrowser
{
IsAntiAlias = true;
CornerRadius = "3,3,3,3";
Height = "320";
Width = "640";
Height = "1920";
Width = "1080";
Background = "#2c2c2c";
ZIndex = 100;
//WindowState = WindowState = WindowState.FullScreen;
Children.Add(new TextBlock
{
MarginRight = 12f,
@ -80,16 +83,16 @@ namespace AksWebBrowser
}
});
//Children.Add(new TextBlock
//{
// FontSize = 16f,
// MarginLeft = 12.6f,
// MarginTop = 9.6f,
// Classes = "imgAndText",
// Foreground = Color.White,
// // Text = videoTitle,
// FontFamily = "微软雅黑",
//});
Children.Add(new TextBlock
{
FontSize = 16f,
MarginLeft = 12.6f,
MarginTop = 9.6f,
Classes = "imgAndText",
Foreground = Color.White,
Text = videoTitle,
FontFamily = "微软雅黑",
});
Children.Add(vplayer);
}

2
CPF_Cef/Common/WebSocketClientWithHeartbeat.cs

@ -199,8 +199,6 @@ namespace AksWebBrowser.Common
}
}
//打开串口
private void OnTimedEvent(Object source, ElapsedEventArgs e)
{

25
CPF_Cef/MainModel.cs

@ -1116,17 +1116,17 @@ namespace AksWebBrowser
}
else
{
//Parame.frm.Invoke(() =>
//{
// new AksVideoPlayer(Parame.frm, param.title, param.url);
//});
Task.Run(() =>
Parame.frm.Invoke(() =>
{
string command = $"pkill vlc";
ShllCommad(command);
command = $"vlc --overlay --video-on-top --fullscreen --video-title={param.title} {param.url}";
ShllCommad(command);
new AksVideoPlayer(Parame.frm, param.title, param.url);
});
//Task.Run(() =>
//{
// //string command = $"pkill ffplay ";
// //ShllCommad(command);
// string command = $"ffplay -autoexit -showmode 0 -x 800 -y 600 -fs -window-title {param.title} {param.url}";
// ShllCommad(command);
//});
string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + "播放成功" + "\"}";
SubmitLogs(result, "playVideo");
return result;
@ -1648,7 +1648,6 @@ namespace AksWebBrowser
//Log.Error("签字版异常:" + ex.Message);
}
}
private static string ttsStr = string.Empty;
/// <summary>
/// 文字转语音
@ -2033,6 +2032,7 @@ namespace AksWebBrowser
}
return tempFile;
}
/// <summary>
/// 是否已获取收取
/// </summary>
@ -2241,8 +2241,7 @@ namespace AksWebBrowser
process.WaitForExit();
}
}
public static string ReadByBody()
{
Task.Run(async () =>
@ -2252,7 +2251,7 @@ namespace AksWebBrowser
@event11.WaitOne();
return body;
}
/// <summary>
/// 读取业务数据
/// </summary>

Loading…
Cancel
Save