[Mono-list] Recommended approach for embedding VLC in a Mono app?
shweta
shweta_salve19 at yahoo.co.in
Thu Jan 19 09:04:02 UTC 2012
THIS IS THE CODE
using System;
using Gtk;
using System.Runtime.InteropServices;
public partial class MainWindow : Gtk.Window
{
private Gtk.Socket socket;
private int xid;
public MainWindow () : base(Gtk.WindowType.Toplevel)
{
Build ();
this.socket = new Socket();
this.socket.WidthRequest = 320;
this.socket.HeightRequest = 240;
this.socket.Visible = true;
this.socket.Realized += new
EventHandler(OnVideoWidgetRealized);
this.fixed2.Put(socket, 0, 0);
}
protected virtual void OnVideoWidgetRealized (object sender,
EventArgs args)
{
this.xid = (int)socket.Id;
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
a.RetVal = true;
this.socket = new Socket();
}
protected virtual void OnButton17Clicked (object sender,
System.EventArgs e)
{
var paramString = string.Format("-wid {0} -vo x11
-really-quiet -msglevel all=-1 gooddog.wmv", xid);
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc.StartInfo.FileName = "/usr/bin/mplayer";
proc.StartInfo.Arguments = paramString;
proc.Start();
proc.WaitForExit();
}
}
--
View this message in context: http://mono.1490590.n4.nabble.com/Recommended-approach-for-embedding-VLC-in-a-Mono-app-tp2216492p4309505.html
Sent from the Mono - General mailing list archive at Nabble.com.
More information about the Mono-list
mailing list