Web Design & SEO Company

Web Design & SEO Company (http://www.tareeinternet.com/forum/)
-   Knowledgebase (http://www.tareeinternet.com/forum/knowledgebase/)
-   -   Control Flash Movie Playing with HTML Approaches (http://www.tareeinternet.com/forum/knowledgebase/4521-control-flash-movie-playing-html-approaches.html)

ted1067 11-05-2009 06:46 AM

Control Flash Movie Playing with HTML Approaches
 
When you are building a site with lots of videos, do you prefer using one style of player to using different style of player according to the video content? It is up to the website management to use one or more player styles. You may use a different web player for special event or topic on your site. If you are using online Flash video player for your videos, it is no longer a hard task to show different video on different page with the same player style. Because Flash movie player can read the variables set in HTML page.

About HTML and Flash
To insert a Flash movie player in HTML page, you shall use Object tag and Embed tag. With both tags, your Flash movie can display on most browsers like Internet Explorer, FireFox, Safari, Netscape and so on. You can define the width and height of the Flash movie player just like image on web page. However, to make the player show up as what you want you shall change the width and height of Flash movie player in both the Object tag and Embed tag. The new code you add in HTML page will be the top level information that controls the presentation.


Approaches to pass variables to SWF in HTML
A variable is a container that holds information for Flash movie player to display on web page. A Flash movie player may recognize multiple variables, and you can add "&" to combine variables. For example, you get two variables: variable1 and variable2. There shall be information for each variable, which is in the format for the related variable. Supposed the information codes are info1 and info2. You may use the syntax variable1=info1&variable2=info2.
According to Adobe, there are 5 ways to set variables in Flash. As some are mentioned using Flash, I would like to summarize the 3 ways to pass variables to SWF in HTML.


Append query string at the end of SWF:
It is to directly add the variables to the end of the .swf with "?" as the combination code, which forms as query string. Just find <param name="movie" value= under Object tag, and <embed src= for Embed tag in HTML page, and the .swf file listed is the place you shall append the query string. Supposed the SWF file is named movie, you may change it to <param name="movie" value="movie.swf?variable1=info1&variable2=info2"> and <embed src="movie.swf?variable1=info1&variable2=info2" in HTML code.

Add FlashVars parameter:

It is to define the FlashVars property in both Object and Embed tag. Different from the method above, you do not need use the combination code, you shall add new parameter. Under the movie parameter in Object tag and above the Embed tag, add <param name="FlashVars" value="variable1=info1&variable2=info2">. Supposed the value for movie parameter is movie.swf, change the Embed tag like <embed src="movie.swf" FlashVars="variable1=info1&variable2=info2" to transfer the new variable to .swf file.

Use JavaScript:
This method varies according to the Flash movie player you choose. We are not going to describe to general term here.

Samples to set variables
As different Flash movie player may have different variables available to pass to SWF file, here I would like to share the variables for the web FLV player exported by Moyea PlayerBox.
To change the Flash video to display on web FLV player, just replace variable1 with videoFile, if the web FLV player does not include playlist function. Change info1 to the URL of the Flash video.
To change the playlist file with Flash videos to show up on web FLV player, just replace variable1 with playList and change info1 to the URL of the playlist file.

To change the first image which displays before the video start playing, change variable1 to firstFrame and info1 to the URL of the image file.

The videoFile variable shall not be combined with playList variable as player by Moyea PlayerBox is divided into two kinds according to the playlist function. The firstFrame variable can be combined with either videoFile or playList. Just change first image to variable2 if you want to combine variables.

cygnet 12-21-2009 10:09 PM

Hey.. I got the information in new topic... its really interesting.. Like to know about that more..


Forum time zone is GMT. Currently it's 10:42 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.