Skip to content

Commit

Permalink
Auto accept stream TLS errors in VLC player
Browse files Browse the repository at this point in the history
  • Loading branch information
berrnd committed Oct 17, 2022
1 parent 8f8b56b commit 3b1563e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions UI/FrmVlcPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b1563e

Please sign in to comment.