LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-19-2012, 06:04 AM   #1
shweta_salve
LQ Newbie
 
Registered: Jan 2012
Posts: 2

Rep: Reputation: Disabled
How to Embed media file in monodevlop Application


hii,
i m using ubuntu 11.10
and working on Monodevelop to create c# apps
i want to embed media control in my app.
can we make videocontrol widget in monodevelop????
so that we can drag drop the control like other controls
....im posting my code,i tried with mplayer
with this code im able to invoke mplayerexe and play video in it.
but this mplayer is opening out side of app.i want it to embed in my gtk widget.
Code:
---------------------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();
        }
}

Last edited by onebuck; 01-21-2012 at 08:59 AM. Reason: vbcode tags
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I embed JMF library in java application (Netbean)? hakeemtunde Programming 1 08-09-2011 11:38 AM
How to embed xterm in qt-3 application? maradnus Linux - Newbie 1 10-08-2009 02:45 PM
xine - how can xine embed firefox to play media b:z Linux - Software 11 07-23-2005 07:14 PM
How can i embed firefox into kde-qt application? ispecial Linux - Software 1 07-06-2005 08:52 PM
embed a media player on the webpage felnlily Linux - Software 1 02-11-2005 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration