-sub ploader {
-
- my $dir = shift;
- my $pattern = shift;
- my $type = shift;
- my @list;
- my $p;
- my $g;
- my @g = ();
-
- unshift(@INC, $dir);
-
- opendir(D, $dir) || return ();
- @list = grep {/$pattern/ && -f File::Spec->catfile($dir, $_) } readdir(D);
- closedir(D);
-
- foreach $p (@list) {
- $p =~ s/\.pm$//;
- eval qq{ require videosite::$p; };
- if ($@) {
- print("Failed to load plugin: $@");
- next;
- }
-
- $g = eval qq{ videosite::$p->new();};
- if ($@) {
- print("Failed to instanciate: $@");
- delete($INC{$p});
- next;
- }
-
- if ($type eq $g->{'TYPE'}) {
- push(@g, $g);
- } else {
- printf('%s has wrong type (got %s, expected %s)', $p, $g->{'TYPE'}, $type);
- delete($INC{$p});
- }
- }
-
- return @g;
-}
-
-sub connectors {
- my $c = {-name => 'environment', -schemas => {}};
-
- if (exists($ENV{'http_proxy'})) {
- $c->{-schemas}->{'http'} = $ENV{'http_proxy'}
- }
-
- if (exists($ENV{'https_proxy'})) {
- $c->{-schemas}->{'https'} = $ENV{'https_proxy'}
- }
-
- return ( $c );
-}
-
-
-my $hq = 0;
-my $ext = '.flv';
-my $y;
-my $f;
-my $m;
-my @g;
-my $bp;