Use flvplayer.swf to play video in Web pages (implementation of Flash video playback in Web pages)

Source: Internet
Author: User

Because of the company's project needs, need to show some information when the video can be played, to get this request, I start from the simplest media play tag <embed>, although this tag can play things, but only partial browser support, personal feel very depressed, If all the browsers are unified, this problem will be solved very well. After the search for plug-in solution, first try the next Media player, with this plugin video can play, but only in IE play, and all other plug-ins used to be more trouble, in this will not elaborate.

Then imagine Youku and other video sites with Flash to play the video (this is really a more reasonable solution, flash users ultra-many), but do not know how to get it, the study of a half-day Youku with Flash when playing how to get, or no clue. After some toss, just know in the Web page embedded Flash video needs a flash player, this Flash player is a SWF file, search on the Internet, Find a flvplayer.swf player (this player supports most 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= "340"  data= "/app/flvplayer.swf" type= "Application/x-shockwave-flash" >< 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 property of the object tag (see the official documentation for other parameters)

    • Width: size of the player
    • Height: level of player
    • Data: The location of your Flash Player
    • Type: Represents your plug-in, Value: Pplication/x-shockwave-flash represents a Flash

The 2.param tag has 2 attributes, one is name and the other is value, which is used to provide some parameter information, as follows: A description of his name and value

    • allowScriptAccess: Whether script access is allowed, value is: TRUE or False
    • Loop: Whether to loop playback with a value of: TRUE or False
    • allowFullScreen: Whether to allow full screen, value: TRUE or False
    • Flashvars: Represents the parameters provided for Flash, the form of each parameter pair such as Name=value, each parameter with & split, such as the above parameter file description of which video file is played at this time (its value is its address).

Finally, add <embed> tags to the end of the </object> to make sure all browsers are available, see the official documentation for embed properties, and set them up with the object and PARAM tags.

Finally provide flvplayer.swf, click here to download

As the video is inserted, it is inserted with the fckeditor, so I wrote a fckeditor plugin to complete the above operation, click here to download

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Use flvplayer.swf to play video in Web pages (implementation of Flash video playback in Web pages)

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.