This is why it works and what Corion already said. The video serves because the context is the file:/// tree. But once you serve the HTML through any kind of webserver, the path to the video will not exist in that context. Probably one of these will work but it depends on the type and configuration of the webserver you are using–
Every perl/CGI problem can be solved if you work through these checklists, when you find a problem on the list, use a solution from the list, when you find a problem not on the list (rare), post the error message and problem description here