in reply to Re^2: Perl not playing video with vlc plugin
in thread Perl not playing video with vlc plugin

From here on, I assume that you already have a static version of the video playback working that does not involve Perl or webmin at all.

Your HTTP headers are very wonky. Please inspect them, again. Like I already told you, you should be using \r\n to delimit your HTTP headers.

The following lines are problematic:

print "Content-Length: $end - $begin\n\n";

This means that for the web browser, all other headers after this get ignored.

Also, this means that your script outputs something like:

Content-Length: 50000000-0

... which is malformed. You will need to actually calculate the length before printing the length header.

You could have found these using the techniques I told you before. Maybe you want to retry these techniques.

Replies are listed 'Best First'.
Re^4: Perl not playing video with vlc plugin
by awanti (Acolyte) on Dec 29, 2015 at 11:20 UTC
    yeah when i check the request and response header it is messing up here is the response header
    Cache-Control: public, must-revalidate, max-age=0Pragma: no-cacheAccep +t-Ranges: bytesContent-Length: 128959310 - 0 Connection: Keep-Alive Content-Type: application/x-vlc-plugin Date: Tue, 29 Dec 2015 11:17:01 GMT Keep-Alive: timeout=5, max=100 Server: Apache/2.2.22 (Ubuntu)
    yeah it is malformed..

      Let me recommend, once again, to use \r\n instead of \n to delimit the HTTP header lines when you print them.

      Also, your Content-Length "header" is still malformed.

        Yeah i added and got this response
        Connection: close Content-Encoding: gzip Content-Length: 391 Content-Type: text/html; charset=iso-8859-1 Date: Tue, 29 Dec 2015 11:39:35 GMT Server: Apache/2.2.22 (Ubuntu) Vary: Accept-Encoding
        but i am getting the internal server error and in the error log it is writing
        Premature end of script headers: download.cgi