public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            var vlcAvailable = LibVlcDynamic.IsVlcAvailable();

            if (Configuration.Settings.General.VideoPlayer == "AVFoundation" || !vlcAvailable)
            {
                _radioAVF.State = NSCellStateValue.On;
                _radioVlc.State = NSCellStateValue.Off;
            }
            else
            {
                _radioAVF.State = NSCellStateValue.Off;
                _radioVlc.State = NSCellStateValue.On;
            }

            if (!vlcAvailable)
            {
                _radioVlc.Enabled = false;
            }

            _radioAVF.Activated += (object sender, EventArgs e) =>
            {
                Configuration.Settings.General.VideoPlayer = "AVFoundation";
            };

            _radioVlc.Activated += (object sender, EventArgs e) =>
            {
                Configuration.Settings.General.VideoPlayer = "VLC";
            };
        }
Example #2
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
         if (_libVlc != null)
         {
             _libVlc.Dispose();
             _libVlc = null;
         }
     }
     base.Dispose(disposing);
 }
Example #3
0
 private void HardSubExtract_Shown(object sender, EventArgs e)
 {
     if (openFileDialogVideo.ShowDialog(this) == DialogResult.OK)
     {
         _videoFileName  = openFileDialogVideo.FileName;
         tbFileName.Text = openFileDialogVideo.FileName;
         _videoInfo      = Utilities.GetVideoInfo(_videoFileName);
         var oldPlayer = Configuration.Settings.General.VideoPlayer;
         Configuration.Settings.General.VideoPlayer = "VLC";
         Utilities.InitializeVideoPlayerAndContainer(_videoFileName, _videoInfo, mediaPlayer, VideoLoaded, null);
         Configuration.Settings.General.VideoPlayer = oldPlayer;
         _libVlc = mediaPlayer.VideoPlayer as LibVlcDynamic;
     }
     else
     {
         DialogResult = DialogResult.Cancel;
     }
 }