Perl bindings

From VideoLAN Wiki
Jump to navigation Jump to search

TODO: this wiki page is work in progress


You need to have libvlc with headers already installed.

TODO: install from CPAN


#!/usr/bin/env perl

use strict;
use warnings;
use 5.010;

use VideoLAN::LibVLC;

unless (@ARGV) {
	die "1 argument needed - path to a file.";

my $inst = VideoLAN::LibVLC::Instance->new;
my $media = VideoLAN::LibVLC::Media->new($inst, $ARGV[0], "path");
my $player = VideoLAN::LibVLC::MediaPlayer->new($media);


sleep 5;
say $player->fullscreen;
say $player->fullscreen;
sleep 5;
say $player->fullscreen;
sleep 5;

Known issues

  • Libvlc event handling is not supported currently.
  • It's unknown whether it works under windows or not, I never tested it there.