Code: Select all
private void button1_Click(object sender, EventArgs e)
{
int idx = axVLCPlugin21.playlist.add("file:///c:/path/to/file/test.mp4");
axVLCPlugin21.playlist.playItem(idx);
}
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
axVLCPlugin21.playlist.add("file:///c:/path/to/file/1.mp4");
axVLCPlugin21.playlist.add("file:///c:/path/to/file/2.mp4");
axVLCPlugin21.playlist.add("file:///c:/path/to/file/3.mp4");
axVLCPlugin21.playlist.play(); //play the first video in playlist
}
private void button1_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.next(); //next item in playlist
}
IP streams will be added at the same way:What if they are not files, but IP streams? One button per stream?
Code: Select all
axVLCPlugin21.playlist.add("http://127.0.0.1:1234");
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.playItem(0);
}
private void button2_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.playItem(1);
}
...
Code: Select all
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 RoomCameraSwitcher
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
axVLCPlugin21.playlist.add("rtsp://xxx.xxx.xxx/live3.sdp");
axVLCPlugin21.playlist.add("rtsp://xxx.xxx.xxx/live3.sdp");
axVLCPlugin21.playlist.add("rtsp://xxx.xxx.xxx/live3.sdp");
axVLCPlugin21.playlist.play(); //play the first video in playlist
}
private void button1_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.playItem(0);
}
private void button2_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.playItem(1);
}
private void button3_Click(object sender, EventArgs e)
{
axVLCPlugin21.playlist.playItem(2);
}
}
}
Code: Select all
//
// button1
//
...
...
this.button1.Click += new System.EventHandler(this.button1_Click);
Code: Select all
//
// Form1
//
...
...
this.Load += new System.EventHandler(this.Form1_Load);
Code: Select all
this.button2.Location = new System.Drawing.Point(529, 714);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
Code: Select all
this.axVLCPlugin21.Enabled = true;
this.axVLCPlugin21.Location = new System.Drawing.Point(183, 60);
this.axVLCPlugin21.Name = "axVLCPlugin21";
this.axVLCPlugin21.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axVLCPlugin21.OcxState")));
this.axVLCPlugin21.Size = new System.Drawing.Size(971, 551);
this.axVLCPlugin21.TabIndex = 0;
this.axVLCPlugin21.Enter += new System.EventHandler(this.axVLCPlugin21_Enter);
Code: Select all
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1298, 889);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.axVLCPlugin21);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.axVLCPlugin21)).EndInit();
this.ResumeLayout(false);
Users browsing this forum: No registered users and 27 guests