Media Player plays video on black screen with sound

-1

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);

    }

Thank you.

    
asked by Fran Pino 06.05.2016 в 18:14
source

1 answer

0

I answer myself, I've put the URL directly in the properties of the Media Player control and it worked correctly. Again I have removed it since the idea was to pass the url by a method and I do not know why but now it works without having touched anything of the code.

I give it for solved then. Thanks

    
answered by 10.05.2016 / 09:58
source