Good afternoon, I have a Windows Media Player control in C# which opens the video but does not show an image, it appears with a black image, but the sound can be heard.
In the Designer window I have the following:
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormVideo));
this.wmPlayer = new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(this.wmPlayer)).BeginInit();
this.SuspendLayout();
//
// wmPlayer
//
this.wmPlayer.Dock = System.Windows.Forms.DockStyle.Fill;
this.wmPlayer.Enabled = true;
this.wmPlayer.Location = new System.Drawing.Point(0, 0);
this.wmPlayer.Name = "wmPlayer";
this.wmPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("wmPlayer.OcxState")));
this.wmPlayer.Size = new System.Drawing.Size(736, 539);
this.wmPlayer.TabIndex = 0;
//
// FormVideo
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.ClientSize = new System.Drawing.Size(736, 539);
this.Controls.Add(this.wmPlayer);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FormVideo";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
((System.ComponentModel.ISupportInitialize)(this.wmPlayer)).EndInit();
this.ResumeLayout(false);
}
Thanks.
I answer to myself, I have put the URL directly in the properties of the Media Player control and it has worked correctly. I have removed it again since the idea was to pass the url through a method and I don't know why but now it works without having touched any of the code.
I'll consider it solved then. Thank you