Thanks PodMaster and Courage,
> But first you must install Tcl/Tk with said widget
I don't want to deal with a full Tcl install, so I bailed on this idea. But thanks for the suggestion, Courage.
> Take a look at Win32::MultiMedia
This worked great! I got it up and running in 5 mins. It did require some debug on the code example, though:
use strict;
use Tk;
use Win32::MultiMedia::Mci;
my $file = shift || 'test.wmv';
my $mw = MainWindow->new();
my $video_frame = $mw->Frame(
-width => 352,
-height => 240,
-background => 'black'
)->pack(-expand => 1);
my $mci = Win32::MultiMedia::Mci->open($file,
shareable => 1,
style => 'child',
parent => hex($video_frame->id)
);
$mci->play('');
MainLoop();
There are 3 bugs in the code:
$mw was not defined, so I added a MainWindow-new().
The mci parent pointed to $frame. It needs to point to $video_frame.
Without the MainLoop(), the program exits immediately without playing the video.
The above code displays a nice little test video window on my screen. This is why I love perl. :)
Thanks again,
TROGDOR
Janitored by Arunbear - replaced pre tags with code tags, as per Monastery guidelines
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.