use Tk; use warnings; use Win32::MultiMedia::Mci; my $file = "pathtofile/file.avi"; my $mw = tkinit; my $counter = 10; my $frame = $mw->Frame(-height => 300, -width =>400)->pack; my $hexid = hex($frame->id); $mci = Win32::MultiMedia::Mci->open($file, 'parent'=>$hexid, 'style'=>'child'); $mci->play('repeat'); $mw->update; while ($counter > 0) { sleep 1; $counter -=1; } $mci->stop(); $mci->close; Mainloop;