Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Use widget MPlayerEmbed in Layer container... I can't see the video

by darkladen (Initiate)
on May 18, 2011 at 20:12 UTC ( [id://905557]=note: print w/replies, xml ) Need Help??


in reply to Re: Use widget MPlayerEmbed in Layer container... I can't see the video
in thread Use widget MPlayerEmbed in Layout container... I can't see the video

Well, thanks for your code but not working. When loading the mplayer does nothing and not sends me an error message. I need to load Mplayer and show over it, a image. The ideal way would be using a widget "Layout" or "Fixed" but when I load a video over either of these widget but it is playing, I can not see.
  • Comment on Re^2: Use widget MPlayerEmbed in Layer container... I can't see the video

Replies are listed 'Best First'.
Re^3: Use widget MPlayerEmbed in Layer container... I can't see the video
by zentara (Archbishop) on May 19, 2011 at 14:08 UTC
      Hi, my platform is Ubuntu 10.10.
        It should work on Ubuntu. What error or operational error are you getting?

        For what it's worth, I do recall having problems with many linux distribution's compilation of mplayer and mencoder, and it's worthwhile to get the mplayer source code, read the compilation instructions in the various README files, and compile it yourself. Mplayer has some patented code which you can use personally, for no profit, but you can't sell it, so the linux vendors release weak and broken mplayer binaries. Just a thought. :-)


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh
      Hello, I tell you that mplayer if I work very well in my distro, I even work on GTK2-perl but only when the container is of the window, vbox, hbox. The problem is when I want to use inside a container type LAYOUT and the hierarchy of the code is something like this:

      * With these examples work but I see no video, only audio.
      # Window-> vbox-> Layout-> MPlayerEmbed (not working)
      # Window-> Layout-> vbox-> MPlayerEmbed (not working)

      * This example works but does not meet my purpose.
      # Window-> vbox-> MPlayerEmbed (works but does not help in this way)

      The code I've left, works to a degree that is stuck. This is what I have in your sample code:
      #!/usr/bin/perl -w use warnings; use strict; use Glib qw/TRUE FALSE/; use Gtk2; use Gtk2 '-init'; use Proc::Killfam; my $pid; #global for killing mplayer on exit my $window = Gtk2::Window->new('toplevel'); $window->set_title('Embed test'); $window ->signal_connect( 'destroy' => \&delete_event ); $window->set_border_width(10); $window->set_size_request(600,600); my $vbox = Gtk2::VBox->new( FALSE, 6 ); $window->add($vbox); $vbox->set_border_width(2); my $hbox= Gtk2::HBox->new( FALSE, 6 ); $vbox->pack_end($hbox,FALSE,FALSE,0); $hbox->set_border_width(2); $vbox->pack_end (Gtk2::HSeparator->new, FALSE, FALSE, 0); my $vbox1 = Gtk2::VBox->new( FALSE, 6 ); $vbox1->set_size_request(600,500); $vbox->pack_end($vbox1,FALSE,FALSE,0); $vbox1->set_border_width(2); my $button = Gtk2::Button->new_from_stock('gtk-quit'); $hbox->pack_end( $button, FALSE, FALSE, 0 ); $button->signal_connect( clicked => \&delete_event ); my $button1 = Gtk2::Button->new('Mplayer'); $hbox->pack_end( $button1, FALSE, FALSE, 0 ); $button1->signal_connect( clicked => \&do_mplayer ); $window->show_all(); Gtk2->main; ##################################### sub delete_event { killfam 9, $pid; Gtk2->main_quit; return FALSE; } ########################################## sub do_mplayer{ my $gdkwindow = $window->window; print "gdkwin->$gdkwindow\n"; my $gdkwindow1 = $vbox1->window; print "gdkvbox->$gdkwindow1\n"; my $xid = $gdkwindow1->XWINDOW; print "xid->$xid\n"; my $url =''; my @options = ( '-slave','-loop 0', '-x 600', '-y 450', '-really-q +uiet', '-wid $xid' ); my $mpg = 'my_video.mp4'; my $init = 'my_video.mp4'; $pid = open(MP, "| mplayer @options $init "); syswrite(MP, "loadfile $mpg\n"); } ########################################
      The script runs fine but not up mplayer.
        work on GTK2-perl but only when the container is of the window, vbox, hbox.

        Well my guess is that the wid ( X window id ) support only allows insertion into the basic container type.

        To delve deeper into your Layer container idea, I would ask on the gtk+ c list and the Perl/Gtk2 maillist. I know nothing about Layer widgets.


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://905557]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-18 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found