The list of all PHP and Mysql posts

How to show flash movies or games and youtube movies

You can place movies or flash component directly on your webpage , by Frontpage program as I explained before:

http://webprogram4beginners.blogspot.com/2011/01/how-to-design-php-website-by-help-of.html

However this is the easiest way but , I explain codes that are needed for flash and youtube players here. I think it's more convenient for an expert to work with codes than Frontpage.

-------------------------------------------
Put a flash game or movie on a page:

This is an example , look at these html codes.

code:

<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="475" height="472">
<param name="movie" value="my_games/game1.swf">
<param name="quality" value="High">
<embed src="my_games/game1.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="475" height="472"></object>

The first part of these codes begins an object (<object) , and some of the object features are defined right here : id , codebase (it's not important to know) and size properties : border , width , height.

The second part is an important line , it contains the name and folder (on the sever) of the flash file that should be shown. In our example the folder is "my_games" and the name of the flash file is "game1.swf" .

The third part determines the quality that flash movie or game should be shown by it. Lower quality causes the flash file to be loaded faster.

The fourth part of the code is also important.

src = "of file path or name"

This code displays the file in front of it on the browser without any hesitation about its format. The file can be an image , flash file or even a PHP page that produces an image temporary.
The code "pluginspage" introduces the plugin that is needed for this Object , here it is "flash player".
The code "type" shows that the file is a flash file (application/x-shockwave-flash).
Object name (id) , height and width should be repeated at the end of the object. The end of the object is assigned by </object>.

-------------------------------------------
Put a youtube movie on a page:

First of all , let's learn about youtube online movie addresses. This is an address for a youtube movie:(just copied from my browser address bar)

http://www.youtube.com/watch?v=boJ36l1llMc&feature=BF&list=PL9618A148C564157A&index=29

if you replace  watch?v=   with   v/   , this address also works but now,  it can be used in yourown webpage.
So edit the address in to:

http://www.youtube.com/v/boJ36l1llMc&feature=BF&list=PL9618A148C564157A&index=29

Infact this part of the address "&feature=BF&list=PL9618A148C564157A&index=29" contains only a bunch of $_GET variables that doesn't have effect on the movie stream (they can be omitted).

Now , you are ready to put a movie object in your page.
Look at these html codes.

code:

<object class="restrain" type="application/x-shockwave-flash" width="640" height="385" data="http://www.youtube.com/v/boJ36l1llMc&feature=BF&list=FLRCuFb8lHRO4&index=41">
<param name="movie" value="http://www.youtube.com/v/boJ36l1llMc&feature=BF&list=FLRCuFb8lHRO4&index=41" />
<param name="wmode" value="transparent" />
</object>

The first part of the codes begins an object from the type of "application/x-shockwave-flash" and defines width and height of the object. The address that we built should be placed in two positions first as the data variable in the first part.
And second as value variable in the second part of the codes. Don't change the third part of the codes. And in the last line the object is ended up  with </object>.

You can now copy , paste the codes here in to your php (or html) files and change just the address , to show yourown movies.

No comments:

Post a Comment