I am trying to play the video file with help of vlc-plugin. Here is my code:-
#!/usr/bin/perl use strict; use warnings; use File::Basename; my $file ='/home/abhishek/Videos/lua.mp4'; my $size = -s "$file"; my $begin=0; my $end=$size; (my $name, my $dir, my $ext) = fileparse($file, qr/\.[^.]*/); open (my $fh, '<', $file)or die "can't open $file: $!"; binmode $fh; print "Content-Type: application/x-vlc-plugin \n"; print "Cache-Control: public, must-revalidate, max-age=0"; print "Pragma: no-cache" ; print "Accept-Ranges: bytes"; print "Content-Length: $end - $begin\n\n"; print "Content-Range: bytes $begin'-'$end'/'$size"; print "Content-Disposition: inline; filename=\"$name$ext\"\n"; print "Content-Transfer-Encoding: binary"; print "Connection: close"; my $cur=$begin; seek($fh,$begin,0); while(!eof($fh) && $cur < $end) { my $buf=1024*16; read $fh, $buf, $end-$cur; $cur+=1024*16; } close $fh;
And here is my access log is writing
127.0.0.1 - - [29/Dec/2015:11:39:31 +0530] "GET /cgi-bin/download.cgi +HTTP/1.1" 200 484 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko +/20100101 Firefox/43.0" 127.0.0.1 - - [29/Dec/2015:11:39:32 +0530] "GET /cgi-bin/download.cgi +HTTP/1.1" 200 447 "-" "(null)"

As I checked what does this mean from apache site,here is what i got

If no content was returned to the client, this value will be "-". To log "0" for no content, use %B instead.

I think the path or file has the issue. No content is returning to the client.It is returning null. I am not able to figure out what is going wrong. Any help what will be grateful.

And please suggest me what should i do to play the video and I am not sure is this the correct way to do?

Thanks in advance

In reply to Perl not playing video with vlc plugin by awanti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.