Vlc::Engine - bindings for perl
version 0.004
use Vlc::Engine; my $player = Vlc::Engine->new(); $player->set_media("your_media"); $player->play(); sleep(30); $player->stop() $player->release();
VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVDs,Audio CDs, VCDs, and various streaming protocols.
my $player = Vlc::Engine->new(); #or with options my $options = ["--no-video", "--no-xlib"]; my $player = Vlc::Engine->new($options);
This constructor returns a new Vlc::Engine object. Optional attributes include: Vlc options, you can get more info if you type vlc -H .
Vlc::Engine
$player->vlc_version();
This method is used to get the version of Vlc.
$player->set_media("your_media");
This method is used to set your media (from local or from network is possible also).
$player->play();
This method is used to start playing your media.
$player->pause();
This method is used to pause your player.
$player->stop();
This method is used to stop your player.
$player->set_volume(70);
This method is used to set volume.
my $volume = $player->get_volume();
This method is used to get volume.
$player->set_mute(1);
This method is used to set mute false or true, 0 is false and 1 is true.
my $mute_status = $player->get_mute();
This method is used to get mute status.
$player->parsing_media();
This method is used to parse your media, it will help to get duration and more info ( you should run it before play).
$player->parsing_media_async();
This method is used to parse your media with asynv, it will help to get duration and more info ( you should run it before play).
$player->get_duration();
This method will help you to get duration of your media by ms.
$player->get_meta('your_meta_param', 'value');
This method is used to modify meta.
$player->save_meta();
This method is used to save meata that you changed.
$player->get_meta('your_meta_param');
This method will help you to get info about your media by using params.
title - Get the title of your track
artist - Get the artist.
genre - Get the genre.
album - Get the Album.
copyright - Get the copyright.
track_number - Get track number.
description - Get description.
rating - Get rating.
date - Get date.
setting - Get setting.
url - Get url.
language - Get language.
now_playinge - Get now playinge.
publisher - Get publisher.
encoded_by - Get encoded by.
artwork_url - Get artwork url.
track_id - Get track id.
track_total - Get track total.
director - Get director.
season - Get season.
episode - Get episode.
show_name - Show name
actors - Get actors.
my $state = $player->get_state();
This method is used to get state of your player.
my $event_manager = $player->event_manager();
This method is used to get an instance of event manager.
$player->event_attach($manager, 'media_player_playing', \&play);
This method is used to run a function when your player get a specifc event. $manager is an event_manager instance 'media_player_playing' is an event, play( is a function. Here are some events that you can check:
media_player_playing
media_player_stopped
media_meta_changed
media_sub_item_added
media_duration_changed
media_parsed_changed
media_freed
media_state_changed
media_subItem_tree_added
media_player_media_changed
media_player_nothing_special
media_player_buffering
media_player_paused
media_player_forward
media_player_backward
media_player_end_reached
media_player_encountered_error
media_player_time_changed
media_player_position_changed
media_player_seekable_changed
media_player_pausable_changed
media_player_title_changed
media_player_snapshot_taken
media_player_length_changed
media_player_vout
media_player_scrambled_changed
media_player_corked
media_player_uncorked
media_player_muted
MediaPlayerUnmuted
media_player_audio_volume
media_list_item_added
media_list_will_add_item
media_list_view_will_add_item
media_list_item_deleted
media_list_will_delete_item
media_list_view_will_delete_item
media_list_player_played
media_list_player_next_item_set
media_list_player_stopped
media_discoverer_started
media_discoverer_ended
vlm_media_added
vlm_media_removed
vlm_media_changed
vlm_media_instance_started
vlm_media_instance_stopped
vlm_media_instance_status_init
vlm_media_instance_status_opening
vlm_media_instance_status_playing
vlm_media_instance_status_pause
vlm_media_instance_status_end
vlm_media_instance_status_error
$player->set_media_list("your_first_media"); $player->set_media_list("your_second_media");
This method is used to set list (from local or from network is possible also).
$player->play_list();
This method is used to play list or medias.
$player->play_next();
This method is used to play next media in the list.
$player->play_previous();
This method is used to play previous media, in the list.
$player->pause_list();
This method is used to pause playing your list.
$player->stop_list();
This method is used to stop playing a list.
For more information, please visit VLC.
James Axl, <jamesaxl@falseking.org>
Please report any bugs or feature requests on my email or create a ticket here
https://fossil.falseking.org/vlc-engine/flk
This is open source software. The code repository is available for public review and contribution under the terms of the license.
Copyleft (C) 2017 by James Axl For the love of the community
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.
To install Vlc::Engine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Vlc::Engine
CPAN shell
perl -MCPAN -e shell install Vlc::Engine
For more information on module installation, please visit the detailed CPAN module installation guide.