Embedding methods for Flash video format (FLV, SWF) files in HTML files

Source: Internet
Author: User
Tags flv file

The format of the Flash file:. FLV and. Swf

The Flash video format has two extensions that can be used:. flv and. swf. What difference do they have?

(1) an. flv file (Flash Video) is a picture-based video stream and audio. If you are running a streaming service, FLV will be a good choice. The upstream condition is that any part of this file can be accessed by the client terminal and will not wait for the download at any time. Then again, running a streaming service is expensive.

(2). SWF is also Macromedia Flash file format, is a complete video-audio file, and has scripts and other more. This will facilitate HTTP (progressive) downloads, also known as "pseudo-random flow (Psuedo streaming)". When a part of the file is downloaded, the video clip plays immediately, but the client waits for the Flash file fragment to be downloaded before it can be accessed (not fast forward) unless the entire file is fully downloaded. This is also what we often talk about, he is a simple, inexpensive, and easy way to stream your video media. SWF is not an official abbreviation and has already been claimed to be "ShockWave Flash" or "Small Web Format".

Embedding flash in a page can be used in the following ways:

Copy CodeThe code is as follows:
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
Codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0"
Width= "height=" >
<param name= "movie" value= "video-filename.swf" >
<param name= "Quality" value= "High" >
<param name= "Play" value= "true" >
<param name= "LOOP" value= "false" >
<embed src= "video-filename.swf" width= "from" "height=" "play=" "true" loop= "false" quality= "high" pluginspage= "http ://www.macromedia.com/go/getflashplayer "
Type= "Application/x-shockwave-flash" >
</embed>
</object>


Note here: <param name= "movie" value= "video-filename.swf" > and <embed src= "video-filename.swf" ..... These two places, are the SWF file location name, some other parameters can refer to the above link in the introduction.

But after this, the files in the SWF format in the page can be displayed, but the files in the FLV format will not play. For a while, a solution was summed up from Dreamweaver:

Copy CodeThe code is as follows:
<script type= "Text/javascript" >
function Mm_checkflashversion (reqverstr,msg) {
With (navigator) {
var Isie = (Appversion.indexof ("MSIE")! =-1 && useragent.indexof ("Opera") = =-1);
var Iswin = (Appversion.tolowercase (). IndexOf ("Win")! =-1);
if (!isie | |!iswin) {
var flashver =-1;
if (plugins && plugins.length > 0) {
var desc = plugins["Shockwave Flash"]? plugins["Shockwave Flash"].description: "";
desc = plugins["Shockwave Flash 2.0"]? plugins["Shockwave Flash 2.0"].DESCRIPTION:DESC;
if (desc = = "") Flashver =-1;
else{
var Descarr = Desc.split ("");
var temparrmajor = Descarr[2].split (".");
var vermajor = temparrmajor[0];
var Temparrminor = (descarr[3]! = "")? Descarr[3].split ("R"): Descarr[4].split ("R");
var Verminor = (Temparrminor[1] > 0)? TEMPARRMINOR[1]: 0;
Flashver = parsefloat (Vermajor + "." + Verminor);
}
}
WebTV have Flash Player 4 or lower--too low for video
else if (Useragent.tolowercase (). IndexOf ("WebTV")! =-1) flashver = 4.0;
var Verarr = Reqverstr.split (",");
var reqver = parsefloat (verarr[0] + "." + verarr[2]);
if (Flashver < Reqver) {
if (Confirm (msg))
window.location = "Http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
}
}
}
}
</script>
<body onload= "mm_checkflashversion (' 7,0,0,0 ', ' The contents of this page need to use a newer Macromedia Flash Player version. Do you want to download it now? ‘);" >
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=7,0,0,0 "width=" 314 "height=" 234 "id=" Flvplayer ">
<param name= "movie" value= "flvplayer_progressive.swf"/>
<param name= "salign" value= "LT"/>
<param name= "Quality" value= "High"/>
<param name= "scale" value= "Noscale"/>
<param name= "Flashvars" value= "&mm_componentversion=1&skinname=clear_skin_3&streamname=%e8%80%81% E5%a4%a9%e4%b8%8b%e8%b4%b0%e4%b9%8b%e8%8e%ab%e9%97%ae%e4%bb%8a%e6%9c%9d&autoplay=true&autorewind=true " />
<embed src= "flvplayer_progressive.swf" flashvars= "&MM_ComponentVersion=1&skinName=Clear_Skin_3& Streamname=%e8%80%81%e5%a4%a9%e4%b8%8b%e8%b4%b0%e4%b9%8b%e8%8e%ab%e9%97%ae%e4%bb%8a%e6%9c%9d&autoplay=true &autorewind=true "quality=" High "scale=" Noscale "width=" 314 "height=" 234 "name=" Flvplayer "salign=" LT "type=" Application/x-shockwave-flash "pluginspage=" Http://www.macromedia.com/go/getflashplayer "/>
</object>


Here's one more version control method Mm_checkflashversion ().

The next section is similar to the SWF notation, but it is slightly different. <param name= "movie" Value= "flvplayer_progressive.swf" is no longer a play file, but rather a player-nature file, and after using Dreamweaver to insert a Flash file, You will find flvplayer_progressive.swf this file and clear_skin_3.swf. The former is equivalent to the player, the latter equivalent to the skin, Dreamweaver provides a variety of skin, can be used according to choice. In the above code there are two places to use the player file flvplayer_progressive.swf, which is very similar to SWF, but he is not a source file. The Skinname in the code is to set the skin, and some of the other properties are better understood.

To summarize, the FLV format Embedded has 3 points: 1, the player flvplayer_progressive.swf, this file is necessary, and this file and the FLV source file in a file directory (not found for a reason) 2. Skin Skinname=clear_ Skin_3, the skin can be replaced, the same is necessary, and the FLV source files together. 3. source file, Streamname, this parameter displays the file name of the source file, without the suffix, when the file name is Chinese, Dreamweaver will know to convert that name to a large string .... When the HTML file and the FLV file are not under the same file directory, you need to bring the file path (this is a special note in the project).



The same page in the illustration uses two skins, one set to AutoPlay, and the other for manual playback. The file format is FLV.

Embedding methods for Flash video format (FLV, SWF) files in HTML files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.