Use flvplayer.swf to play the video in the Web page (the realization of Flash video playback in the webpage)

Source: Internet
Author: User

Due to the needs of the company project, the need to display some information when the video can be played, to get this request, I will be from the simplest media play tag <embed> start, although this tag can really play things, but only part of the browser support, individuals feel very depressed, If all browsers are unified, the problem will be solved well. After the search for plug-in solutions, first tried the next Media player, use this plug-in video can play, but only in IE play, and all other plug-ins to use more trouble, in this will not elaborate.

Later imagine Youku and other video sites like using Flash to play video (this is really a more reasonable scheme, flash users more than), but do not know how to do it, research for half a day cool with flash play when how to get, or no clue. After some toss, just know that in the Web page embedded Flash video needs a flash player, this Flash player is a SWF file, a search on the internet, Find a flvplayer.swf player (this player supports most of the formats) and the final video is finally ready to play.

To play the video, you need to embed the following code in the HTML page:


<object width= "460" height= "Data="/app/flvplayer.swf "type="  >
<param value= "/app/flvplayer.swf" name= "movie"/> <param value= "
always" name= "allowScriptAccess"/>
<param value= "window" name= "wmode"/> <param value=
"true" name= "Swliveconnect"/>
<param Value= ' false ' name= ' Loop '/>
<param value= ' true ' name= ' play '/>
<param ' value= ' true ' name= ' allowFullScreen "/>
<param value=" false "name=" menu "/> <param value=
" file=/app/mymovie.flv &showfsbutton=true&autostart=true "name=" Flashvars "/>
</object>

1. Description of the properties of the object label (see the Official document of the Consortium for other parameters)

Width: Size of the player: height of the player data: the position of your Flash Player type: Indicates your plug-in types, value: Pplication/x-shockwave-flash represents a Flash

The 2.param tag has 2 properties, one is name, and the other is value, which is used to provide some parameter information, as follows: Is the description of his name and value allowscriptaccess: Whether script access is allowed, value is: TRUE or false loop: Whether to loop, the value is: TRUE or false allowfullscreen: whether the full screen is allowed, the value is: TRUE or false flashvars: represents the parameters provided for Flash, the form for each parameter pair, such as Name=value, each parameter is & Split, for example, the parameter file above describes which video file is playing at this time (its value is its address).

Finally, add <embed> tags to the end of the </object> to ensure that all browsers are available, for embed properties refer to the official documentation, which can be set with the object and PARAM tags.

Finally provide flvplayer.swf download address, click here to download

Because the fckeditor is inserted when inserting the video, so I wrote a fckeditor plugin to complete the above operation, download the address here click here to download

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.