Browse Source

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

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

31
CPF_Cef/AksVideoPlayer.cs

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

2
CPF_Cef/Common/WebSocketClientWithHeartbeat.cs

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

21
CPF_Cef/MainModel.cs

@ -1116,17 +1116,17 @@ namespace AksWebBrowser
} }
else else
{ {
//Parame.frm.Invoke(() => Parame.frm.Invoke(() =>
//{
// new AksVideoPlayer(Parame.frm, param.title, param.url);
//});
Task.Run(() =>
{ {
string command = $"pkill vlc"; new AksVideoPlayer(Parame.frm, param.title, param.url);
ShllCommad(command);
command = $"vlc --overlay --video-on-top --fullscreen --video-title={param.title} {param.url}";
ShllCommad(command);
}); });
//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\":\"" + "播放成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + "播放成功" + "\"}";
SubmitLogs(result, "playVideo"); SubmitLogs(result, "playVideo");
return result; return result;
@ -1648,7 +1648,6 @@ namespace AksWebBrowser
//Log.Error("签字版异常:" + ex.Message); //Log.Error("签字版异常:" + ex.Message);
} }
} }
private static string ttsStr = string.Empty; private static string ttsStr = string.Empty;
/// <summary> /// <summary>
/// 文字转语音 /// 文字转语音
@ -2033,6 +2032,7 @@ namespace AksWebBrowser
} }
return tempFile; return tempFile;
} }
/// <summary> /// <summary>
/// 是否已获取收取 /// 是否已获取收取
/// </summary> /// </summary>
@ -2242,7 +2242,6 @@ namespace AksWebBrowser
} }
} }
public static string ReadByBody() public static string ReadByBody()
{ {
Task.Run(async () => Task.Run(async () =>

Loading…
Cancel
Save