I am trying to play the video from the <video> tag with the cgi script. Here is my code
#!/usr/bin/perl use warnings; use strict; use CGI; my $cgi = CGI->new; print $cgi->header( -type=> "text/html" ); print <<EOF; <video width="320" height="240" controls> <source src="/home/ubuntu_Workspace/c/video.mp4" type="video/mp4"> </video> EOF
When i keep the file in the server i can play it.But if i keep the video file in some other directory it wont play the video instead it will give the error. After doing some research i came to know that it should be in the path where server can access that directory.So the most cases it would be /var/www/ path.But what should i do when the video files are in the different paths.I mean it could be able to play the file whichever path it may be.

In reply to (OT) HTML video tag is not working in cgi 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.