SoFunction
Updated on 2025-03-09

Online FLV player implementation method

Program code
Copy the codeThe code is as follows:

<object type="application/x-shockwave-flash" width="400" height="220" 
wmode="transparent" data="">
<param name="movie" value="" />
<param name="wmode" value="transparent" />
<object/>


"" will automatically find the playback of "" in the same directory. You can also add the URL of the FLV file after "" to play. The method is as follows:
Copy the codeThe code is as follows:

<object type="application/x-shockwave-flash" width="400" height="220" 
wmode="transparent data="?file=movies/">
<param name="movie" value="?file=movies/" />
<param name="wmode" value="transparent" />
</object>


"file=movies/" is a parameter, and relative or absolute addresses can be used.

Other parameter description:

If the video does not need to be automatically played when loading, you can use the "autostart" parameter
example

Program code

<object type="application/x-shockwave-flash" width="400" height="220"
wmode="transparent" data="?autostart=false">
<param name="movie" value="?autostart=false" />
<param name="wmode" value="transparent" />
</object>

Multiple parameters can be used in a mixed manner, and the effective parameter list:

Program code
file (the address of the FLV file)
autostart (whether autoplay is allowed, "true" or "false")
image (Preview images when not played, only support JPEG format)
repeat (whether to play it repeatedly)
clicktext (The text displayed at the beginning is "click to play" by default)

---------------------------------------------------------------
The following is version 3.12/bbs/Medias/2007/10/jw_flv_player.zipThis is version 3.12
This document contains the installation method and configuration method of JW MP3 Player, JW FLVPlayer, JW Media Player, JW Image Rotator
Law

JW PLAYERS 3.12 Documentation

1. Install (embed in your site)
2. Parameters (Configuration)
Basic parameters
Color parameters
Interface parameters
Playback parameters
Interactive parameters
3. Playlist
4. Customize
5. Support

Quick configuration, run the configuration wizard

1. Install
After downloading, you can get an example, when opened with text or HTML editor, you can find that swf is a short piece of
Javascript embedded on the page. This Javascript was written by Geoff Stearns, which solves the need for Flash
The trouble of life. When copying swf to your site, don't forget to copy them together. And on the page
Add the following code to the head

Program code

<script type="text/javascript" src=""></script>

With the help, you can easily set the path, width, height, background color and the version of the Flash player you need, or you can set a set of parameters to configure swf. When the page is loaded, javascript will replace the nodes in the page according to the id.

Program code

<p ><a href="/go/getflashplayer">Get Flash</a> to see this player.</p>
<script type="text/javascript">
var so = new SWFObject('','player','400','400','7');
("allowfullscreen","true");
("file","");
("displayheight","300");
('player');
</script>

In situations where you cannot use javascript (such as your bsp does not support it, such as myspace), you can use "embed" to insert swf.
It should be noted that swf can not be on this server, but if you need to use xml playlists, there may be problems, because xml must be on the same server as swf, otherwise it will be organized due to security issues. mp3, jpg, flv can not be on this server.

Program code

<embed src="/folder/" width="400" height="400"
type="application/x-shockwave-flash" pluginspage="/go/getflashplayer"
flashvars="file=/folder/&displayheight=300" />

2. Parameters
These parameters can configure the behavior and appearance of the player embedded in the html. If used, you can use the addVariable() method to configure it. If you use the embed method, you can configure the variables by defining the "flashvars" attribute. Pay attention to using the "&" symbol to divide these variables.

The same is true for JW Image Rotator marked with *

Basic variables

displayheight(number): The height of the display area. The minimum height of the control area is 20px. When this value is greater than or equal to the height of swf, the playlist will be automatically hidden, otherwise this will be displayed.
file*(url): The address of the file to be played. Supports single file playback (MP3/FLV/RTMP/JPG/SWF/PNG/GIF), and also supports playlists. JW Image Rotator only supports lists
height*(number): Set the height of swf. When inserting using embed, it has been set in the embed property. But sometimes (especially when using IE) the height becomes uncertain, which affects the layout. At this time, you need to set this parameter, and the unit of this value is px
image(url): When you play mp3 and flv, you can set a preview image as the album cover through this value, supporting JPG/SWF/PNG/GIF file. You can also set each item in the playlist.
shownavigation*(true, false): This parameter is only supported by JW Image Rotator. Used to show or hide image navigation.
transition* (fade,bgfade,blocks,bubbles,circles,fluids,lines,random,slowfade): This parameter is only supported by JW Image Rotator. Used to set the effect of image replacement. Setting to "random" will set the effect randomly. The default value is "fade".
width*(number): Set the width of swf, the other is the same as height;

Color variables

backcolor*(color): Sets the background color of the player. JW Media Player, etc., default to 0xFFFFF (white) JW Image Rotator, default to 0x000000 (black).
fontcolor*(color): Sets the color of text and buttons. JW Media Player, etc., default to 0x000000 (black) JW Image Rotator, default to 0xFFFFF (white).
lightcolor*(color): Sets the color of the activated state. JW Media Player, etc., default to 0x000000 (black) JW Image Rotator, default to 0xCC0000 (red).

Interface parameters

autoscroll(true,false): When the playlist is too long, the scroll bar will be automatically displayed by default. When this value is set to 'true', the playlist will be automatically scrolled according to the mouse.
displaywidth(number of pixels): Set the width of the display area. When the setting is relatively small, the playlist will be displayed on the right side of the display area instead of the bottom.
kenburns* (true,false): Used to achieve kb effect during exercise. Note that when the picture is larger and the internet speed is faster, it is recommended to turn on, otherwise close. It is recommended to set transition to "slowfade" to cooperate.
largecontrols (true,false): Set this value to true to enlarge the button for the control area. It is recommended to open it for users with poor eyesight
logo* (url): Set an image as the watermark in the upper right corner, supports all image formats, and supports the best png effect of the transparent layer.
overstretch* (true,false,fit,none): Sets the zoom of the picture/video in the display area. "true" equal proportion stretch is used to fit the display area. "false" only stretches the display area. "fit" is displayed in full screen. "none" shows the original size. JW Media Player, etc. default to "fit", and JW Image Rotator default to "false"
showdigits (true,false,total): Set to "false" to hide playback time and other information to save space in the control area. Set to "total" to display all time.
showdownload (true,false): Set this value to display the download button in the control area. Link to the address set by link.
showeq (true,false): Used to display a false audio fluctuation effect. When playing mp3, you can get a good effect
showicons* (true,false): Used to display or hide pictures in the middle of the display area. JW Media Player, etc. default to true. JW Image Rotator defaults to false;
showvolume (true,false): Used to set whether to display the volume control button
thumbsinplaylist (true,false): Sets whether the preview image is displayed in the list

Playback parameters
autostart (true,false,muted): Set to ture, the page will automatically play after loading. Set to muted, it will automatically play in silent mode, and there will be a mute icon in the middle of the display area.
bufferlength (number): Sets the cache time of flv. Default is 3 seconds
repeat* (true,false,list): Default is flase, and it stops after playing from the current playback position to the end of the list. Set to list will play all items in the list, and set to true will play it loop.
rotatetime* (number): Sets the display time of the image. JW Media Player, etc. are default to 10 seconds, and JW Image Rotator is default to 5 seconds.
shuffle* (true,false): Set to false to play sequentially, set to true to play unorderly
smoothing (true,false): Set to false to turn off video smoothing processing. It is recommended to set true to get better results. But it is beneficial to set false for large screens or low-configured machines.
start* (second): When using RTMP or HTTP streaming media (unconventional flv/mp3), use this variable to accurately locate the start position. This parameter is set in the XSPE format list to accurately set the file section.
volume* (number): Set the volume, default to 80.

Interactive parameters

audio* (url): Use this parameter to add an mp3 file as a separate audio, which can be used as a background music explanation of the picture, etc.
bwfile (url): The address of the file used for bandwidth detection, you can put a picture, or rtmp streaming media. The loan value can be viewed in the right-click menu.
bwstreams (comma-separated list of bitrates):
Use it in conjunction with bwfile to select different files according to the bandwidth value. For example: You want to play and set the value of this item to 100,250,500,1000. When the player finds that the bandwidth is 349kbps, video_250.flv will be played. So he has an effective naming setting, which he will automatically switch, even if using playlists.
callback (url): Set this parameter to the server program (php/asp) address to pass data back. Data is sent to the server when each item is played and stopped, so that the play statistics are saved on the server side.
captions (url): Set this value to load a text in text format as subtitles. Player to subtitles that support SMIL format and DVD format. If your flv file has built-in fonts you can set the value to "captionate". If you have multi-channel subtitles, you can set this value to "captionate0", "captionate3", etc. The value of each item can be set in the list.
enablejs* (true,false): Set to true to enable support for javascript. Online use is only supported. JavaScript can control playback, load media, and obtain detailed information about the current playback item.
fsbuttonlink (url): If the user's flashplayer version is higher than (9.0.28), the player will automatically display a full screen button. By setting this value, you can link to another page for full screen display. The server can set the file to be played.
id (string): The unique identifier of the player. It will be returned to the server.
javascriptid* (string): If you have multiple players on your page, you can set this parameter to give each player a different id, so that you can easily control it with javascript. He will be returned to the getUpdate() event.
link (url): Use this parameter to set a current version, or force the user to download the current item through this address. This value can be set for each item in the playlist.
linkfromdisplay* (true,false): Sets the page to be accessed when the display area is clicked. By default, the play/pause operation will be performed when the display area is clicked.
linktarget* (frame): Set the link target, "_self" opens on the current page. "_blank" opens in a new page.
streamscript (url): Set this parameter to be compatible with 'pseudo-streaming' FLV files.
type (mp3,flv,rtmp,jpg,png,gif,swf,rbs,3gp,mp4,m4v): The player will judge the type based on the last three characters of the file name. This method will no longer work when you redirect using a server-side language. So you can set this parameter to tell the player the file type. You can also set each item in the playlist. If the player cannot find the file type, it will be recognized as a playlist.
useaudio (true,false): Set to false to change to the silent state.
usecaptions (true,false): Set to false to hide subtitles.
usefulscreen (true,false): If you don't want to use flashplayer9's full screen mode. The "fsbuttonlink" parameter can be set to replace the events of the full screen button.
usekeys (true,false): Set to "false" to cancel keyboard operations (SPACE, UP, DOWN, LEFT, RIGHT)

Note: You must transfer character to ?=&. ? → %3F, = → %3D, & → %26. When your "file" variable is ?id=123, it must be set to %3Fid%3D123.

Playlist

When there is only one item in the playlist, the player will play in single-file playback mode. The player distinguishes single file from playlist files based on file name. If you load a file with the file name test.mp3, the player will play mp3 in single file playback mode, because the extension is mp3. If your file name is, the player will think it is a playlist. If you use dynamic scripts to load a single file like

The player supports three commonly used playlist formats to ensure universality. XSPF, RSS and ATOM.

A common label for the XSPF/RSS/ATOM list supported by the player.
sheet


*Image Rotator only supports the first 'audio' item in the playlist and is used as background music to play. The player will play all music items.

** The "category" element can be used to support ads. You can set the value to "preroll", "postroll" or "overlay".
Use the value of a single item in the "link" playlist as the ad address.

*** The "start" element is only supported by the playlist format of XSPF. This element is used to set the start position of the streaming media file (HTTP or RTMP) in seconds.

**** If the "location" element in the XSPF list format does not contain common extensions (such as "mp3" or "flv"), you can use the "meta" element to specify the file format. (such as <meta rel='"type">mp3</meta>). When using RSS and ATOM, the file format is automatically recognized according to mimetype.

RTMP streams, the additional "id" flashvar has to be sent as well. Example: "file=rtmp:///mypath" and "id=video_one".

Note that when you play a single file, you support all parameters, such as you can add an image, title, id, link, etc. If you want to add a preview image when you use single file playback mode to play "", you can set the parameter "file=","image=". When you play RTMP streaming media, you can add the parameter "id". For example, "file=rtmp:///mypath" and "id=video_one".

In particular, two error-prone places are pointed out. The first list must be on the same server as the player, which is caused by flash security mechanism. Second, use the full address format to include http so that the player cannot find the file.

Customize
Many people asked me to create some customizable versions. Many of their requirements can actually be achieved by setting parameters. I made an online configuration wizard to simply configure these parameters. I don't have the energy to meet everyone's requirements. There will be a lot of interesting additional features in the next version, though.

If you are familiar with the actionscript script language, you can modify the program and add functions yourself.

When the player is in the instance, the configuration and playlist variables will be added recently, and then the MCV life cycle will be entered. The configuration and list manager (feeder) are always valid during the MCV lifecycle.

All methods of the two objects marked in red can be called through javascript.

In other flash programs, players can be referenced. Just copy the image from the downloaded flv file and make sure to copy the downloaded com directory into your flv file, which contains all the scripts. Then you can access the variables at the location of the first frame of the timeline. Be careful to set the variables of height and width, otherwise the player will stretch and deform according to your size.
like

Program code

// Set the flashvars (booleans and numbers should also be quoted)
var width = "320";
var height = "240";
var file = "my_video.flv";
var autostart = "true";
// Start the player
var mpl = new ();
Additionally, I have made the controller a public object, so you can control the mediaplayer with the sendEvent() function from anywhere in your flash site (the schematic above has a list of all sendEvent() options). Let's continue the small script above:

I created an exposed controller object for the player, so you can control the player anywhere in your program by using sendEvent() like:

Program code

("volume",50);
("playpause");

support

List of FAQs

1. If you have a mislay layout when using ie, it may be that the size is not set well. You can use the variables "width" and "height" to force it.
2. Note that the security mechanisms of flash and javascript will affect your local tests. You can also be affected when your files are placed on different servers, and you can try to put them on the same server.
3. The full screen function can only be used in flash player9.028.0 or above. If you use swfobject to embed your player, you can use its automatic upgrade function. Note that "allowfullscreen" is set to true
4. If your progress bar doesn't move, or there is a problem with the length of your video. That might be that your flv is not setting the correct metadata. You can use a widget /flvmdi/.

The two versions are slightly different, please see the instructions below for details
Official download link: /upload/jw_flv_player.zip