From 59b41f393b7a29624b329fffcfdea2c1faa30012 Mon Sep 17 00:00:00 2001 From: jasonchenwork Date: Wed, 3 Sep 2025 17:34:33 +0800 Subject: [PATCH] 2509031734 --- DBObj/SongData.cs | 2 +- VideoPlayerForm.cs | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/DBObj/SongData.cs b/DBObj/SongData.cs index 4d67087..1517e13 100644 --- a/DBObj/SongData.cs +++ b/DBObj/SongData.cs @@ -122,7 +122,7 @@ namespace DBObj var check = IsFtpUriReachable(new Uri(server).ToString()); if (!string.IsNullOrWhiteSpace(server) && check != false) { - Console.WriteLine(new Uri(new Uri(server), filename)); + // Console.WriteLine(new Uri(new Uri(server), filename)); if (IsFtpUriReachable(new Uri(new Uri(server), filename).ToString())) return new Uri(new Uri(server), filename); } } diff --git a/VideoPlayerForm.cs b/VideoPlayerForm.cs index 22b7478..88ef3aa 100644 --- a/VideoPlayerForm.cs +++ b/VideoPlayerForm.cs @@ -126,6 +126,8 @@ namespace DualScreenDemo this.Controls.Add(PrimaryForm.Instance.videoView1); PrimaryForm.Instance.videoView1.MediaPlayer = _mediaService1.Player; PrimaryForm.Instance.videoView0.MediaPlayer = _mediaService0.Player; + //同步畫面比例 + _mediaService0.Player.AspectRatio = "8:5"; _mediaService0._zero = true; PlayNextSong(); } @@ -347,16 +349,21 @@ namespace DualScreenDemo try { string pathToPlay = song.getFile(); - Uri url = song.getFileUrl(); - if (pathToPlay == null) _mediaService0.LoadMedia(url, 0); - //同步畫面播放器載入media設置參數 - else _mediaService0.LoadMedia(pathToPlay, 0); - // _mediaService0.Player.Media.AddOption(":no-audio"); - _mediaService0.Player.AspectRatio = "8:5"; - if(pathToPlay==null)_mediaService1.LoadMedia(url, song.isPublicSong ? 0 : 1); + Uri url = song.getFileUrl(); //影片畫面播放器載入media設置聲道 - else _mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1); - + if (pathToPlay == null) + { + _mediaService0.LoadMedia(url, 0); + _mediaService1.LoadMedia(url, song.isPublicSong ? 0 : 1); + } + else + { + _mediaService0.LoadMedia(pathToPlay, 0); + _mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1); + } + // _mediaService0.Player.Media.AddOption(":no-audio"); + // _mediaService0.Player.AspectRatio = "8:5"; + isVocalRemoved = true; if (isMuted) { Mute(true); } @@ -364,7 +371,8 @@ namespace DualScreenDemo SetVolume(100 + song.getBasic().getDbChange()); Task.Run(() => Thread.Sleep(100)); if (isSyncToPrimaryMonitor) SyncToPrimaryMonitor(); - if (url == null&&!song.isPublicSong) PlayNextSong(); + //ftp抓不到檔案跳下一首歌 + if (url == null && !song.isPublicSong) PlayNextSong(); PrimaryForm.Instance.standardKeyButton.PerformClick(); return Task.CompletedTask; }