From 3b1563e4b6b69b4f22bd1cf67f87e113b0d4fe0a Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 17 Oct 2022 22:41:25 +0200 Subject: [PATCH] Auto accept stream TLS errors in VLC player --- UI/FrmVlcPlayer.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/UI/FrmVlcPlayer.cs b/UI/FrmVlcPlayer.cs index f452f22..ef28aee 100644 --- a/UI/FrmVlcPlayer.cs +++ b/UI/FrmVlcPlayer.cs @@ -2,6 +2,8 @@ using LibVLCSharp.WinForms; using System; using System.IO; +using System.Threading; +using System.Threading.Tasks; using System.Windows.Forms; using Traything.Data; @@ -22,6 +24,7 @@ private void SetupVlc() { Core.Initialize(Path.Combine(Program.BaseExecutingPath, "libvlc\\win-x64")); this.VlcLib = new LibVLC(); + this.VlcLib.SetDialogHandlers(VlcDlgError, VlcDlgLogin, VlcDlgQuestion, VlcDlgDisplayProgress, VlcDlgUpdateProgress); this.VlcVideoView = new VideoView(); this.VlcVideoView.MediaPlayer = new MediaPlayer(this.VlcLib); this.VlcVideoView.MediaPlayer.Paused += MediaPlayer_Paused; @@ -121,6 +124,33 @@ private void TrackBarPlayProgress_Scroll(object sender, EventArgs e) { this.VlcVideoView.MediaPlayer.SeekTo(TimeSpan.FromSeconds(this.TrackBarPlayProgress.Value)); } + + private Task VlcDlgUpdateProgress(Dialog dialog, float position, string text) + { + throw new NotImplementedException(); + } + + private Task VlcDlgDisplayProgress(Dialog dialog, string title, string text, bool indeterminate, float position, string cancelText, CancellationToken token) + { + throw new NotImplementedException(); + } + + private Task VlcDlgQuestion(Dialog dialog, string title, string text, DialogQuestionType type, string cancelText, string firstActionText, string secondActionText, CancellationToken token) + { + // Auto accept stream TLS errors + dialog.PostAction(1); + return Task.CompletedTask; + } + + private Task VlcDlgLogin(Dialog dialog, string title, string text, string defaultUsername, bool askStore, CancellationToken token) + { + throw new NotImplementedException(); + } + + private Task VlcDlgError(string title, string text) + { + throw new NotImplementedException(); + } } public class TransparentPanel : Panel