search
HomeWeb Front-endHTML TutorialHow to add flash video format (flv, swf) files in html

This time I will show you how to add flash video format (flv, swf) files in html. What are the precautions for adding flash video format (flv, swf) files in html? What are the following? This is a practical case, let’s take a look at it.

Flash file formats: .FLV and .SWF

Flash video format has two extensions available: .flv and .swf. How are they different?

(1) A .flv file (flash video) is a video stream and audio based on picture. If you are running a streaming service, flv would be a good choice. The upstream condition is that any part of this file can be accessed by the client terminal and is not waiting to be downloaded at any time. Then again, running a streaming service is expensive.

(2).swf is also the Macromedia Flash file format, which is a complete video-audio file and has scripts and more. This will facilitate HTTP (progressive) downloads, also known as "psuedo streaming". When part of the file is downloaded, the video clip plays immediately, but the client will wait for the flash file fragment to download before accessing it (no fast forwarding) unless the entire file is downloaded in its entirety. This is what we often talk about, it is a simple, inexpensive, and convenient way to stream your video media. SWF is not the official abbreviation. Some people have claimed that it is the abbreviation of "ShockWave Flash" or "Small Web Format".

You can use the following method to embed flash in the page:

<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="320" height="400" > <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="320" height="400" play="true" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed> </object>

What should be noted here is:

 <param name="movie" value="video-filename.swf">
 <embed src="video-filename.swf"..

These two places are the locations of swf files. For the name and other parameters, please refer to the introduction in the link above.

But after writing this, although the swf format files in the page can be displayed, the flv format files cannot be played. After struggling for a while, I summarized a solution from dreamweaver:

<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 has 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> 
</head> 
<body onload="MM_CheckFlashVersion(&#39;7,0,0,0&#39;,&#39;本页内容需要使用较新的 Macromedia Flash Player 版本。是否现在下载它?&#39;);"> 
<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>

There is an additional version control method MM_CheckFlashVersion().
The lower part is very similar to the swf writing method, but slightly different. To summarize, there are three key points for embedding flv format: 1. Player FLVPlayer_Progressive.swf, this file is essential, and this file must be in the same file directory as the flv source file (the reason has not been found yet) 2. Skin skinName=Clear_Skin_3, the skin can be changed, it is also essential, and it must be together with the flv source file. 3. Source file, streamName, this parameter displays the file name of the source file without a suffix. When the file name is Chinese, dreamweaver will know to convert that name into a large string. . . . When the html file and the flv file are not in the same file directory, you need to bring the file path (this should be paid special attention to in the project).

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to set input to read-only effect through disabled and readonly

Google Browse label and How to solve the input spacing problem

How to implement refresh redirection of HTML header tag meta

The above is the detailed content of How to add flash video format (flv, swf) files in html. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML: Building the Structure of Web PagesHTML: Building the Structure of Web PagesApr 14, 2025 am 12:14 AM

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

From Text to Websites: The Power of HTMLFrom Text to Websites: The Power of HTMLApr 13, 2025 am 12:07 AM

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

Understanding HTML, CSS, and JavaScript: A Beginner's GuideUnderstanding HTML, CSS, and JavaScript: A Beginner's GuideApr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The Role of HTML: Structuring Web ContentThe Role of HTML: Structuring Web ContentApr 11, 2025 am 12:12 AM

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment