Embedded flash player on web page (2), embedded flash
Next, in the previous blog, we will introduce the embedding of another flash player. This is a Flash Player used within the company. It supports many formats and supports swf video playback.
Below is the page embedding code:
<Link rel = "stylesheet" type = "text/css" href = "<% = request. getContextPath () %>/flash/history/history.css "/> <script type =" text/javascript "src =" <% = request. getContextPath () %>/flash/history. js "> </script> <script type =" text/javascript "src =" <% = request. getContextPath () %>/flash/swfobject. js "> </script> <script type =" text/javascript "> // For version detection, set to min. required Flash Player version, Or 0 (or 0.0.0), for no version detection. var swfVersionStr = "11.1.0"; // To use express install, set to playerProductInstall.swf, otherwise the empty string. var xiSwfUrlStr = "playerProductInstall.swf"; var flashvars ={}; // resource prepath, for the path to be loaded with flash, for example: http://demo.com/assets/flash/ var assetPath = "<% = request. getContextPath () %>/flash/"; // configure the resource path flashvars. url = '<c: out value = "$ {generateSwfUrl}"/>'; // View Video Playback path. You can dynamically assign values to flashvars. duration =$ {duration}; // video duration. You can dynamically assign a value to var params ={}; params. quality = "high"; params. bgcolor = "#000000"; params. allowscriptaccess = "sameDomain"; params. allowfullscreen = "true"; params. wmode = "transparent"; var attributes ={}; attributes. id = "VideoPreviewer"; attributes. name = "VideoPreviewer"; attributes. align = "middle"; // anti-Cache var d = new Date (); flashvars. time = d. getT Ime (); var preloaderUrl = assetPath + "VideoPreviewer.swf" + "? Time = "+ flashvars. time; // preloader.swf swfobject. embedSWF (preloaderUrl, "flashContent", "380", "290", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes ); // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. swfobject. createCSS ("# flashContent", "display: block; text-align: left;"); </script> <div class = "publish_video"> <center style = "position: relati Ve; top: 0px; left: 0px; margin: 0px; padding: 0px; background: #000000; overflow: hidden; "> <div id =" flashContent "style =" position: relative; top: 0px; left: 0px; margin: 0px; padding: 0px; "> <p> To view this page ensure that Adobe Flash Player version 11.1.0 or greater is installed. </p> <script type = "text/javascript"> var pageHost = (document. location. protocol = "https :")? "Https: //": "http: //"); document. write ("<a href = 'HTTP: // www.adobe.com/go/getflashplayer'> </a> "); </script> </div> <noscript> <object classid = "clsid: d27CDB6E-AE6D-11cf-96B8-444553540000 "width =" 390px "height =" 390px "id =" VideoPreviewer "> <param name =" movie "value =" VideoPreviewer. s Wf "/> <param name =" quality "value =" high "/> <param name =" bgcolor "value =" # ffffff "/> <param name =" allowScriptAccess" value = "sameDomain"/> <param name = "allowFullScreen" value = "true"/> <! -- [If! IE]> --> <object type = "application/x-shockwave-flash" data = "VideoPreviewer.swf" width = "370px" height = "277px"> <param name = "quality "value =" high "/> <param name =" bgcolor "value =" # ffffff "/> <param name =" allowScriptAccess "value =" sameDomain "/> <param name = "allowFullScreen" value = "true"/> <! -- <! [Endif] --> <! -- [If gte IE 6]> --> <p> Either scripts and active content are not permitted to runor Adobe Flash Player version 11.1.0 or greater is not installed. </p> <! -- <! [Endif] --> <a href = "http://www.adobe.com/go/getflashplayer"> </a> <! -- [If! IE]> --> </object> <! -- <! [Endif] --> </object> </noscript> </center> </div>
Note: This is only the embedded code of the page. He also needs some resource files. I put all the required resource files as demos in a folder and packed them into a space.
: Http://download.csdn.net/detail/smszhuang168/7689225
Summary: The flash embedding method is similar, but it is nothing more than dynamically passing in some parameters with js. The main code is in the flash object, and the Code on the page is basically similar.
How can I insert a flash player into a webpage?
<Object classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "download.macromedia.com/..sion=6," width = "80" height = "80">
<Param name = "movie" value = "calling the flash Address in the Database">
<Param name = "quality" value = "high">
<Param name = "wmode" value = "transparent">
<Param name = "menu" value = "false">
<Embed src = "calling the flash Address in the Database" width = "80" height = "80" wmode = transparent quality = "high" pluginspage = "www.macromedia.com/go/getflashplayer" type = "application/x -shockwave-flash "menu =" false "> </embed>
</Object>
How to add a Flash Player to a webpage
<Script type = "text/javascript" src = "changmc.com/audioplayer.js"> </script>
<Script type = "text/javascript" src = "changmc.com/flashobject.js"> </script>
<Div> <B> song name </B> </div>
<Div id = "8902" style = "width: 290; height: 24;"> </div>
</Div>
<Script type = "text/javascript"> var fo = new FlashObject ("changmc.com/images/audioplayer.swf", "audioplayer8902", "290px", "24px", "7"); fo. addParam ("quality", "high"); fo. addParam ("FlashVars ", "playerID = 8902 & bg = 0xf8f8f8 & leftbg = 0 xeeeeee & lefticon = 0x666666 & rightbg = 0 xcccccc & rightbghover = 0x999999 & righticon = 0x666666 & rightihover = 0 xFFFFFF & text = 0x666666 & slider = 0x666666 & track = 0 xFFFFFF & border = 0x666666 & loader = 0 xdedede & loop = yes & soundFile = 90.shangdu.com/..09.mp3 "); fo. addParam ("wmode", "transparent"); fo. addParam (&...... remaining full text>