use File::Spec::Functions qw(catfile catdir);
use POSIX qw(strftime);
+use Utils::PresentingPerl;
+
sub log_info (&) { print $_[0]->(), "\n"; }
sub run {
$info->{author} = $choice;
}
}
+ my $size = get_file_size($video_file . '.' . $video_files->{$video_file}[0]);
$info->{name} = prompt('What is the name of this talk?', $info->{name});
(my $slug = lc $info->{name}) =~ s/ /-/g;
$info->{slug} = prompt('What is the slug for this talk?', $slug);
+ $info->{width} = prompt('What is the width of the video resolution?', $size->{width});
+ $info->{height} = prompt('What is the height of the video resolution?', $size->{height});
$info->{bucket} = $bucket;
$info->{announcement} = $ann;
$videos{$video_file} = bless($info, 'App::IdiotBox::Video');
\%videos;
}
+sub get_video_size {
+ my ($filename) = @_;
+
+ my $size = {};
+ if($filename =~ /\.flv$/) {
+ eval { $size = Utils::PresentingPerl::get_flv_info($filename, [qw/width height/]);};
+ if($@) {
+ print "Looking for $filename size, failed, returning 0s\n";
+ return { width => 0, height => 0 };
+ }
+ }
+}
+
1;