View Full Version : CGI for embedded video
peteher
02-01-2005, 07:19 PM
Can anyone help me out? I'm trying to create my own pop-up window with embedded videos when video links are clicked on my site. Basically, what I'm trying to do can be seen here - http://www.zeegisbreathing.com/ --> click on Jackson Mann Skateboarding. This is what I'm trying to do, but I've never used CGI and cannot figure out how to accomplish this. I'm also using dreamweaver to write my code. Thanks a lot.
Viper007Bond
02-01-2005, 09:18 PM
We talking about popping up the window or displaying the video here?
The window is done with Javascript and the code for that can be gotten from the page's source:
<a href="javascript://" onclick="video_win=window.open('/videos/view-video.cgi?jackson.mov', 'video_win', 'height=335, width=336')">Jackson Mann Skateboarding</a>The contents of the window that's opened are generated via a CGI script that displays the video that's specified.
It was written in CGI since that's probably what the coder was comfortable in. I however have no knowledge, or interest even :P, in CGI. I do however know PHP and can help you with a PHP script for displaying videos.
So, using their site as an example and basis, I'd do this. A file would be called "view-video.php" in the "videos" folder.
You can do the format they did "/videos/view-video.php?jackson.mov", but I'd personally go "/videos/view-video.php?filename=jackson.mov". Makes life a lot easier from a coding standpoint.
Then using that, you can just use this code to get the page they have:
<HTML>
<HEAD>
<TITLE>ZEEG{isbreathing}</TITLE>
<META name="description" content="Quicktime Videos">
<META name="keywords" content="Nick Zegel Documentary">
<link rel="stylesheet" type="text/css" href="../stylesheet.css"/>
</HEAD>
<body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center><br>
<EMBED SRC="<?php echo $_GET['filename']; ?>" WIDTH=320 HEIGHT=256 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE="http://www.apple.com/quicktime/"><BR><BR>
<font style="font-family: arial, helvetica, sans-serif; font-size: 17px; letter-spacing:-1px; line-height : 17px; color: #FFFFFF; font-weight: bold;">ZEEG{isbreathing}</font>
<br>
<font style="font-family: arial, helvetica, sans-serif; font-size: 10px; color: #FFFFFF;">dotcom</font><br>
</BODY>
</HTML>
You could also do some more complex coding like having a file/database that stores the resolution of the video if your videos have varying dimensions as well as some code to make sure that the video file you're calling actually exsists.
Post if you want help with either of those things or anything else.
peteher
02-01-2005, 11:28 PM
Wow, thanks a lot for your help... I just tested everything and it works great.
I really appreciate the quick response.
Viper007Bond
02-02-2005, 02:37 AM
No problem. :)
po00o
05-12-2005, 10:11 PM
I want to do this with wmv files.... how can I do that?
Thanks for the help
Whiteknight
05-16-2005, 10:13 AM
just a quick note: CGI is not a language, it's a protocall for interacting an executable file to the webbrowser. Most likely, the view-video.cgi script from the example code was written in Perl, but it easily could have been written in Python, or C. Less easily (and more complex then necessary) it could have even been written in a PHP script, or in Java.
Viper007Bond
05-17-2005, 06:27 PM
I want to do this with wmv files.... how can I do that?
Thanks for the help
Same way, but you'll probably need to change the <embed> tags to something else. Go find an embedded WMV file out on the web and see what HTML they use to display it.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.