I want to make stream application for RTSP cam to open VLC
when I press the button show to me the stream in the application but it doesn't show to me anything I want the program to display the stream in VLC
this the code of the application using c#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace vlc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axVLCPlugin21_Enter(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.add("rtsp://192.168.0.209:554/mpeg4", "live", "network-caching=75");
//pictureBox1.Visible = false;
axVLCPlugin21.playlist.play();
}
}
}
Related
I'm sorry, I speak a little English.
The button3_Click is work, but the Form1_Resize it does not work.
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
namespace FirstApp
{
public partial class Form1 : Form
{
private void button3_Click(object sender, EventArgs e)
{
this.Hide();
notifyIcon1.Visible = true;
}
private void Form1_Resize(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
notifyIcon1.Visible = true;
}
}
}
}
Why? What is the problem?
I'm beginner in C#, sorry.
I was wondering if it's possible to stop this popup from showing when I run my application? I'm loading external URLs in the HTML loaded in the form's WebBrowser component.
Screenshot:
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.webBrowser1.Navigate(Application.StartupPath+#"\simple_flash_and_xml_sample\xml_sample.html");
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Speech.Recognition;
namespace tofuchanfra
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
wplayer.URL = #"C:\Users\Cristi\Music\DOOM CROSSING Eternal HorizonsMusic Video feat. Natalia Natchan.mp3";
wplayer.controls.play();
}
}
}
I am trying to make a Winforms program that plays an audio file, there is no error when debugging but when I fire it up and press the button, nothing plays.
I have tried to make another button and use that one but it still doesn't work, any help?
I'm trying to build a simple media player. It has only Browse button, Play button and media player screen. I tried with Windows Media Player and VLC Media Player. In both codes below, Button1 is for browsing the video. Button2 is for playing. Browsing is working right but if I click Button2, nothing happens, and also I tried to see message if exists but it is not going to catch.
If I use Windows Media Player, I use this code;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace videoplayerdeneme
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
OpenFileDialog opf = new OpenFileDialog();
if (opf.ShowDialog() == DialogResult.OK)
{
//textBox1.Text = opf.FileName;
axWindowsMediaPlayer1.URL = opf.FileName;
}
}
private void Button2_Click(object sender, EventArgs e)
{
try {
axWindowsMediaPlayer1.Ctlcontrols.play();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
When I want to use VLC Media Player, I use this code;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace videoplayerdeneme
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
OpenFileDialog opf = new OpenFileDialog();
if (opf.ShowDialog() == DialogResult.OK)
{
//textBox1.Text = opf.FileName;
axVLCPlugin21.playlist.add(opf.FileName, opf.SafeFileName, null);
}
}
private void Button2_Click(object sender, EventArgs e)
{
try {
axVLCPlugin21.playlist.play();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
What am I missing in both cases? Please help me.
EDIT
I didn't add 64-bit VLC Media Player to Toolbox so I installed 32-bit version even my computer has 64-bit
i am new to .net i am having trouble playing videos automatically. I would be showing different textboxes here but i want the video to autplay without any buttons
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WMPLib;
namespace ThinkQDisplay
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
AxWindowsMediaPlayer1.URL = "C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sample.avi";
}
}
}
It keeps telling it is an unrecognized escape sequence. Also I would like to have a separate form (form2). Where I can choose what to play here on form 1. Is it also possible to have it looped?
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
axWindowsMediaPlayer1.URL = #"C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sampler.avi";
}
private void Form1_Load(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.autoStart = true;
}
}
}