Web coding help please!

Want to just shoot the breeze? Forum 42 is the place!

Moderator: Moderators

bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Web coding help please!

Post by bicostp »

Ok, I have been lax about updating my site lately. (Mainly because with the current layout it's a P.I.T.A. :P, but school and night courses at college don't help much either.) But fear not! I'm going to copy the FrontPage project folder over to my new machine this weekend, and I'll start updating it with the new content.

But that's kind of beside the point of this thread. What I want to do is have a pop-up video player type of system. It will be easier to show than explain what I'm after, so here:

<img src="http://img430.imageshack.us/img430/8810 ... yer4zz.gif">

Any ideas on how to do this (probably in php), or links to already-done scripts that can do this? (I know it can be done with iFrames, but then there is the need for dozens of html pages, so that would really be the hard way of doing this.)

Thanks! :)
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

Ya, PHP is the way to go with this.

You'll want to make a link to a popup window, in dreamweaver it's called _blank.

The link would be something like this: playvideo.php?id=dougcoolshoes

And then a HTML/PHP script analizing it.

"Play video" code

Code: Select all

<embed name='RAOCXplayer' src='http://yoursite.com/videos/<?php echo $id; ?>' autostart='true' type='application/x-mplayer2' width='300' height='250' showcontrols='1' showstatusbar='0' loop='True' enablecontextmenu='0' displaysize='0' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed>
If you need further help with anything, just ask.
Last edited by Skyone on Fri Mar 31, 2006 4:28 pm, edited 1 time in total.
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

Ya but hes going to need to link to various different sites meaning slightly different coding per thing. Or more complicated to start with. I suggest you choose one place nad host all the files there.
Image
blackbox_dev
Senior Member
Posts: 1906
Joined: Sun Jan 15, 2006 5:19 pm
Location: Formerly known as iam7805

Post by blackbox_dev »

I wish I could program in PHP... :( VB6 and x86 assembler isn't too helpfull on the interweb. :wink:
I'd imagine right now you wish you were a cuttlefish...
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

sam fisher wrote:I suggest you choose one place nad host all the files there.
That's pretty lame. It's really not that hard, actually.

Bic, if your interested, I could help create a PHP enabled site.
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

I know you could just use various variables but they can't contain '/'s so it could get complicated depending on the various different sites structures however it would be done differently, aka a different page page completly, for each site.
Image
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

Not really, it's quite simple actually.

Code: Select all

/playvideo.php?id=<?php echo $id; ?>
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

sya the location was videos.google.com/bla/bla.swf or what ever would that not need '/'s which I was under the impression could not be stored in a variable.
Image
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

Oh, ok. For a while I thought he just wanted to make a video MANAGER. Not linker.

You'd just add this then:

Code: Select all

<?php 
$id="http://videos.google.com/poop/video.wmv"; 
?>
Or if it's a .swf, you'd just replace the WMV code with SWF.
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

I thought variables could not contain '/'s. I assume from your statement that they can. Are you sure?
Image
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

I'm pretty sure they can, I don't remember trying it though.

I know they just can't contain quotes ("'s).
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

When tryign to use it on my xbox site it didnt work. I had to use multiple variables and keep all my files basically in the same place.
Image
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

Maybe you could link it to mySQL?
sam fisher
Posts: 1093
Joined: Mon Apr 25, 2005 8:52 am

Post by sam fisher »

That would be the best way I think. Althought I dont think PoD has provided him wiht a database. I could give him one if he needs one but a different page for different sites may work if they have a standard location of their files.
Image
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

There are basically only 3 places I'll link videos from. YouTube, Google Video, and eventually some .swf files of my own.

Sample codes:

YouTube

Code: Select all

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/dnfUlIXiSuQ"></param><embed src="http://www.youtube.com/v/dnfUlIXiSuQ" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
Google Video:

Code: Select all

<embed style="width:400px; height:326px;" id="VideoPlayback" align="middle" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?videoUrl=http%3A%2F%2
Fvp.video.google.com%2Fvideodownload%3Fversion%3D0%26secureu
rl%3DkwAAAOzmuT1Qofk3r1RXwlIG_LOpOwLO-ttnDp5bqnTtfYN-Os4L
7uFMimgba_IieQXHThi0UYS9EvJckwN-lXNQK1wbsrslqPj1bMSi6xlYrTpF5
x7ZgmEn5I2jLeYcDz0Xix4JelHrlDoZgD1tDfX7NTGsewmAeIJ1foA64II1_
93d49ESWC9_5xwRwDnum4HtoaOotAnHwuuaeDTl5qmPsc8%26sigh%3
DAKkhOEC8xZ_0lGiCB6FUGo0zS8I%26begin%3D0%26len%3D137932
%26docid%3D-82974780013461890&thumbnailUrl=http%3A%2F%2Fvi
deo.google.com%2FThumbnailServer%3Fcontentid%3D76f8a15dee194
dac%26second%3D5%26itag%3Dw320%26urlcreated%3D1143846704
%26sigh%3DtENKasd3JxSZDHR_UXDnFsXKesg&playerId=-8297478001
3461890" allowScriptAccess="sameDomain" quality="best" bgcolor="#ffffff" scale="noScale" wmode="window" salign="TL"  FlashVars="playerMode=embedded"> </embed>
(I added line breaks so it would stay in the frame.)

I think maybe the easiest way to do what I'd like it to do is a variable-based substitution. In the php page it would have something like [videohere] in the box the video goes in, and in another part it sets [videohere] as a variable (with the information pulled from a comma delimited text file or something. Maybe a database?)

I think the scrolling list could go in a seperate HTML page in an iFrame (in the space I mentioned earlier), and the links would be something like mysite.not/media/player.php?id=1, mysite.not/media/player.php?id=42, etc... The movie played depends on the ID number.

The video embed code, ID numbers, and comments could probably be all stored in a database.

I think a variable system woudl work well for this because it will work for Windows Media, RealPlayer, Flash, and other streaming formats.

Only 2 problems:
1. I don't know if such a system is possible with PHP (it probably can be done, though.)
2. I don't know how to code it. :P

Think this will work?
Post Reply