Looking at the source of the module, it sets: $self->{play} = 0; in new().
And it issues the warning you are seeing from ->length() in line 58:
warn 'No File Loaded' if($self->{play}==0);
and ->volume() in line 44:
warn 'No File Loaded' if($self->{play}==0);
But ->load(), successful or not, doesn't set that variable:
sub load { my $self = shift; my $file = shift; $result = doMM("open \"$file\" type mpegvideo alias ".$self->{alias}); return $result; }
Only ->play() does:
sub play { my $self = shift; my $pos = shift || $self->{pos}; $self->{play} = 1; $result = doMM("play ".$self->{alias}." from $pos"); return $result; }
And it sets it regardless of whether the attempt to play the file was successful or not.
This doesn't help you fix your program, but it -- along with the lack of indentation and other clues in the source code; the age of the bug reports on RT; -- may give you an indication of the quality of this module and your chances of solving the problem.
In reply to Re: Win32::MediaPlayer not playing sound
by BrowserUk
in thread Win32::MediaPlayer not playing sound
by TROGDOR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |