DC
|
| Posted: 05/05/2002, 6:43 PM |
|
What code should I use (php4 with templates) to automatically play a streaming video file (mymovie.wmv) when a page is loaded? Furthermore, what event should the code be placed in?
Lastly, is it possible to embed the video inside the body of the web page rather than have Windows media Player open in it's own window?
Thanks for your patience!
|
|
|
 |
DC
|
| Posted: 05/06/2002, 8:20 AM |
|
For those interested, here's the solution:
In the form's header place the name of the movie if you desire. In the form's footer, place the following code...
----------------------------------------
<div align="Center"><table cellpadding="2" cellspacing="2" border="5" width="100%"><tbody><tr><td valign="Middle" align="Center"><object id="MediaPlayer" width="320" height="240" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject"><param name="FileName" value="mypath/mymovie.wmv"><param name="autostart" value="1"><param name="showcontrols" value="0"><embed type="application/x-mplayer2" src="mypath/mymovie.wmv" width="320" height="240" autostart="1" showcontrols="0"></object></td></tr></tbody></table></div>
---------------------------------------
Note: Replace "mypath" with your url path (in 2 places)like "http://www.raisingthestandards.com/videos/mymovie.wmv" or "videos/mymovie.wmv". I'm not yet clear as to whether or not the visitor has to have Windows Media Player installed using this method.
Hope this helps others,
Donna
|
|
|
 |
DC
|
| Posted: 05/07/2002, 10:48 AM |
|
The code above works great but I need a bit more out of it. I need to replace the hard coded filename with a field variable. Since this is html source code placed in the form footer, I don't know how to write it properly. I would like to replace.... src="mypath/mymovie.wmv" .... with src="mysqlfield" and replace value="mypath/mymovie.wmv" with value="mysqlfield".
Does anyone know how to do this?
Thanks,
Donna
|
|
|
 |
Nicole
|
| Posted: 05/08/2002, 5:09 AM |
|
Hello,
you can place php var in footer, e.g:
src="<?=$mysqlfield ?>"
and assign value to it in form Open or Before Show event.
|
|
|
 |
DC
|
| Posted: 05/08/2002, 8:34 AM |
|
Nicole,
I'm trying to following your instructions, but it's still not working. Here's what I did.
FORM FOOTER......
<div align="Center"><table cellpadding="2" cellspacing="2" border="5" width="100%"><tbody><tr><td valign="Middle" align="Center"><object id="MediaPlayer" width="320" height="240" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="application/x-oleobject"><param name="FileName" value="<?=$mysqlfield ?>"><param name="autostart" value="1"><param name="showcontrols" value="0"><embed type="application/x-mplayer2" src="<?=$mysqlfield ?>" width="32" height="240" autostart="1" showcontrols="0"></object></td></tr></tbody></table></div>
FORM BEFORE SHOW EVENT.....
$tpl->set_var("mysqlfield", $fldfilepath); //didn't work so I replaced it with the following line.
$mysqlfield = $fldfilepath; //This didn't work so I tried the actual file path next just to see if that would even work.
$mysqlfield = "images/reeftank2.wmv"; //It didn't work either
Am I leaving something out elsewhere?
Thanks!
|
|
|
 |
DC
|
| Posted: 05/08/2002, 8:41 AM |
|
I have 3 forms on my page. The goal is to click on an URL in frmMovieIndex and have that play the correct movie in the embedded Windows Media Player contained in frmVideo. Maybe the reason it's not working is because the code isn't being updated after I click an url.
I have no idea!
|
|
|
 |
DC
|
| Posted: 05/08/2002, 10:37 AM |
|
I had to change several things. If anyone needs to know how to accomplish this I will list the details in full.
|
|
|
 |
Donna
|
| Posted: 05/08/2002, 10:55 AM |
|
I ended up using $tpl->set_var("myinsert", $fldfilepath);
to solve the problem.
Thanks again for your help!
|
|
|
 |
DaViD
|
| Posted: 08/02/2002, 3:25 PM |
|
DC, can you tell me thecode for displaying video from database w PHP4 with templates?
Thanks David
|
|
|
 |
AC
|
| Posted: 02/18/2003, 3:26 PM |
|
"I will list the details in full. "
I'll be glad to see details..pls
|
|
|
 |