Gtk2::Ex::MPlayerEmbed 0.02 review

Download
by rbytes.net on

Gtk2::Ex::MPlayerEmbed is a widget to embed the MPlayer media player into GTK+ applications. SYNOPSIS use Gtk2::Ex::MPlay

License: Perl Artistic License
File size: 6K
Developer: Gavin Brown
0 stars award from rbytes.net

Gtk2::Ex::MPlayerEmbed is a widget to embed the MPlayer media player into GTK+ applications.

SYNOPSIS
use Gtk2::Ex::MPlayerEmbed;

my $window = Gtk2::Window->new;

my $embed = Gtk2::MPlayerEmbed->new;

$window->add($embed);

$window->show_all;

$embed->play("movie.mpg");

Gtk2->main;

Gtk2::Ex::MPlayerEmbed allows you to embed a video player into your applications. It uses the XEMBED system to allow the mplayer program to insert its window into your application.

OBJECT HIERARCHY
Glib::Object
+----Gtk2::Object
+----Gtk2::Widget
+----Gtk2::Container
+----Gtk2::Socket
+----Gtk2::Ex::MPlayerEmbed

PROPERTIES
The following properties are accessible through the standard Glib get() and set() methods:

mplayer_path

This is the path to the mplayer program. This is /usr/bin/mplayer by default.
args

This is a string containing the command line arguments passed to mplayer (no default).

loaded

This is a boolean value that indicates whether the mplayer program is currently running.

state

This is an enumeration (described by Gtk2::Ex::MPlayerEmbed::PlayingState) that indicates the state of the player. state may be one of: stopped, playing, paused. It is stopped at startup.

METHODS

$embed->play([$content]);

This method has two behaviours: if the the loaded property is true (a video stream has been loaded), and the state property is paused, then it will resume playing the stream. If loaded is true but the stream is not paused, then the method will carp() and return undef.

If load is false, and the $content argument is defined, then the player will attempt to load and play the stream identified by $content, which may be a path to a file, the URL of a network resource, or a "meta-URI" such as dvd:// or dvb://.

$embed->pause;

This method will pause the current video stream. If the stream is not playing, this method will carp() and return undef.

$embed->resume;

This is just a convenience wrapper around pause(). The pause() method is really a toggle, and two subsequent calls to pause() will pause and then resume the stream, so this method exists to disambiguate.

$embed->stop;

This method tells mplayer to quit, and resets the widget's internal state. Before loading another video stream with play(), use this method first.

$embed->tell_slave($something);

This method sends a command to the mplayer slave process. The available commands are documented in the mplayer-slave-spec.txt file in the source distribution.

Requirements:
Perl
Gtk2
mplayer

Gtk2::Ex::MPlayerEmbed 0.02 search tags