JW Player Detailed Parameters
1 , installation
After downloading, you can get an example that when opened with a text or HTML editor, you can see that the SWF is using a short
JavaScript is embedded on the page. This javascript is Geoff Stearns write Swfobject.js, it solves the flash need to stress
The trouble of living. When copying the SWF to your site, don't forget to copy the Swfobject.js together. and in the page
Add the following code to the head
Program code
<scripttype= "Text/javascript" src= "Swfobject.js" ></script>
With the help of swfobject.js you can easily set the SWF path, width, height, background color and the desired version of the Flash Player, or you can set a set of parameters to configure the SWF. When the page loads, JavaScript replaces the nodes in the page based on the ID.
Program code:
<pid= "Player" ><ahref= "Http://www.macromedia.com/go/getflashplayer" >GetFlash</a> to see this Player.</p>
<script type= "Text/javascript" >
var so = new SWFObject (' mediaplayer.swf ', ' Player ', ' 400 ', ' 400 ', ' 7 ');
So.addparam ("allowFullScreen", "true");
So.addvariable ("File", "test.flv");
So.addvariable ("Displayheight", "300");
So.write (' Player ');
</script>
In situations where you cannot use JavaScript (such as your BSP is not supported, such as MySpace), you can use "embed" to insert the SWF.
It is important to note that the SWF can not be on the server, but if you need to use an XML playlist it may be problematic because the XML must be on the same server as the SWF, otherwise it will be organized because of security issues. MP3,JPG,FLV can not be on this server.
Program code
<embedsrc= "http://www.myfileserver.com/folder/mediaplayer.swf" width= "height=" 400 "
Type= "Application/x-shockwave-flash" pluginspage= "Http://www.macromedia.com/go/getflashplayer"
flashvars= "file=http://www.myfileserver.com/folder/test.flv&displayheight=300"/>
2 , the parameter
These parameters allow you to configure the behavior and appearance of the player that is embedded in the HTML. If you use Swfobject.js, you can configure it with the AddVariable () method, and if you use the Embed method, you can configure the variable by defining the "Flashvars" attribute, and be careful to split the variables with the "&" symbol.
The same as the * number is applied to the JW Image rotator
Basic variables
Displayheight (number): Displays the height of the area. The minimum height of the control area is 20px, and when the value is greater than or equal to the height of the SWF, the playlist is automatically hidden, no this is displayed.
file* (URL): The address of the file to play. Supports single-file playback (mp3/flv/rtmp/jpg/swf/png/gif), and also supports playlists. JW Image Rotator only supports lists
height* (number): Sets the height of the SWF, which is already set in the properties of embed when inserted using embed mode. But sometimes (especially when using IE) the height will become uncertain, affecting the layout, this time needs to be set by this parameter, the value of the unit is PX
Image (URL): When you play mp3,flv, you can set a preview image as the album cover and support Jpg/swf/png/gif file. You can also set up each item in the playlist.
shownavigation* (true,false): This parameter is supported only by the JW Image rotator. Use to show or hide picture navigation.
transition* (Fade,bgfade,blocks,bubbles,circles,fluids,lines,random,slowfade): This parameter is supported only by the JW Image rotator. Used to set the effect of picture substitution. Set to "random" to set the effect randomly. The default value is "fade".
width* (number): Sets the width of the SWF, other same height;
Color variables
backcolor* (color): Sets the background color of the player. The default is 0xFFFFFF (white) for JW Media player, and the default is 0x000000 (black) for JW Image rotator.
fontcolor* (color): Sets the colors of text and buttons. The default for JW Media player such as 0x000000 (black) for JW Image Rotator is 0xFFFFFF (white).
lightcolor*: Sets the color of the activated state. The default for JW Media player such as 0x000000 (Black), JW Image Rotator, is 0xcc0000 (red) by default.
interface Parameters
AutoScroll (true,false): When the playlist is too long, the scroll bar is automatically displayed by default. When the value is set to ' true ', the playlist is automatically scrolled according to the mouse.
Displaywidth (Number of pixes): Sets the width of the display area, and when the settings are small, the playlist appears on the right side of the display area instead of the bottom.
kenburns* (True,false): To achieve the implementation of the KB effect in motion (Ken burnseffect), note that when the figure is relatively large, and the speed is relatively fast, it is recommended to open, otherwise closed. It is recommended to set transition to "Slowfade" to fit.
Largecontrols (True,false): Sets the value to true to enlarge the control area of the button. It is recommended to open the
logo* (URL) for a user with poor eyesight: set a picture to use as the watermark in the top right corner, support all picture formats, and support the PNG effect of the brightly-lit layer best.
overstretch* (True,false,fit,none): Sets the zoom of the picture/movie in the display area. The "true" proportional stretch is used to fit the display area. "False" stretches only the display area. "Fit" is displayed in full screen. "None" displays the original size. The default is "fit" for JW Media player, and JW Image rotator defaults to "false"
Showdigits (true,false,total): set to "false" to hide information such as playback time to conserve space in the control area. Set to "Total" to display the full time.
Showdownload (True,false): Sets the value used to display the download button in the control area. Links to the address set by link.
Showeq (true,false): Used to display a false audio ripple effect. When playing MP3, set this value to get a good effect
showicons* (true,false): Used to show or hide the middle of the display area of the picture, JW Media player, such as the default is true. JW imagerotator defaults to false;
Showvolume (True,false): Used to set whether the Volume Control button is displayed
Thumbsinplaylist (true,false): Sets whether the preview is displayed in the list
Playback parameters
Autostart (true,false,muted): Set to Ture, the page will play automatically when it finishes loading. Set to muted, it automatically plays in silent mode, and there is a mute icon in the middle of the display area.
Bufferlength (number): Sets the cache time for FLV. Default is 3 seconds
repeat* (true,false,list): The default is Flase, which stops after playing from the current playback position to the tail of the list. Set to list all items in the playlist, and set to True to loop back.
rotatetime* (number): Sets the display time of the picture. The default is 10 seconds for JW Media player, and the default is 5 seconds for JW Imagerotator
Shuffle* (True,false): set to False in order to play, set to true for unordered multicast
Smoothing (True,false): set to False to turn off video smoothing, it is recommended to set true to get better results. But it's good to set false for a big screen or a low-profile machine.
start* (second): Use this variable to position the starting position exactly when using rtmp or HTTP streaming (unconventional Flv/mp3). This parameter is set in the list of XSPE formats so that the section of the settings file is accurate.
volume* (number): Sets the volume by default to 80.
Interactive Parameters
audio* (URL): Use this parameter to add a MP3 file as a separate audio, can be used as a picture of the background music commentary and so on.
Bwfile (URL): The address of the file used for bandwidth detection, can be placed in a picture, or rtmp streaming media. You can view the value of the loan in the right-click menu.
Bwstreams (comma-separated List of bitrates):
In conjunction with Bwfile, select different files based on the bandwidth values. Such as: You want to play video.flv and set the value of the key is 100,250,500,1000, when the player found that the bandwidth is 349kbps, will play video_250.flv. So he has a set of valid naming settings that he will automatically switch to, even in the case of playlists.
Callback (URL): Set this parameter to pass data back and forth to the server-side program (php/asp) address. When each item is played and stopped, data is sent to the server to save playback statistics on the server side.
Captions (URL): Sets the value to load text in a text format as a caption. Player to subtitles in SRT format that supports SMIL format and DVD. If you have an FLV file built-in font you can set the value to "captionate". If you have multi-channel subtitles, you can set this value to "Captionate0", "Captionate3" and so on. You can set a value for each item in the list.
Enablejs* (True,false): set to True to turn on JavaScript support. Only online use is supported. JavaScript can control playback, load media, and get detailed information about the current playlist.
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 files that will be played.
ID (String): Unique identifier of the player. will be sent back to the server side.
Javascriptid* (String): If you have multiple players on your page, you can set this parameter to a different ID for each player so that you can easily control it with JavaScript. He will be posted back to the GetUpdate () event.
Link (URL): Use this parameter to set a version that is available now, or to force the user to download the current item from that address. You can set this value for each item in the playlist.
linkfromdisplay* (True,false): Sets the page to be accessed when the display area is clicked. The play/Pause action is performed when the display area is clicked by default.
Linktarget* (frame): Set the link target, "_self" opens on the current page. "_blank" opens in a new page.
Streamscript (URL): Set this parameter in order to be compatible with ' pseudo stream media ' flv files.
Type (MP3,FLV,RTMP,JPG,PNG,GIF,SWF,RBS,3GP,MP4,M4V): The player will determine the type based on the last three characters of the file name. This method will no longer work when you redirect using the server-side language. So you can set this parameter to tell the player file type. You can also set up 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 mute state.
Usecaptions (True,false): set to False to hide captions.
Usefullscreen (True,false): If you don't want to use FLASHPLAYER9 full-screen mode. You can set the "Fsbuttonlink" parameter to replace the full-screen button event.
Usekeys (True,false): set to "false" to cancel keyboard operation (space,up,down,left,right)
Repeat playback mode: List column mode, none single mode, always cycle mode
Autostart is autoplay: true,false
Stretching zoom mode: Fill is scaled uniform centered, exactfit stretched, none no
New SWFObject (Hostplayer + "player.swf", "Adplayer", Wid, Hei, "9");
Adplayer.sendevent (event); Event value 1.stop stop video, 2. Play start
/*
* Monitor the status of the player, Statetracker is automatically called when the state changes
*state value: 1.playing playback in 2.paused stop 3.idle idle 4. Completed end
**/
Adplayer.addmodellistener ("state", "Statetracker");
Play the index of the video in the playlist
Slplayer.sendevent ("ITEM", I);
Set up a radio container label
Sobj.write ("Slplayerspace");
Duration video Duration (playback time)
----------------------JS version of the Jwplayer method is documented--------------------
Jwplayer (). GetPosition ();//How many seconds played
Jwplayer (' Playerdiv '). Play (); | |
Jwplayer (0). Play (True/false); Whether to play 0 as index
Jwplayer (0). Pause (True/false); Whether to pause
Jwplayer (0). Stop (); Stop no parameter
Jwplayer (). GetBuffer (); % of load
Jwplayer (). Getfullscreen (); Setfullscreen (state);//whether Fullscreen
Jwplayer (). Getmute (); Setmute (state)//whether Mute
Jwplayer (). Getplaylist () [0][' file '] | |
Jwplayer (). Getplaylistitem (0) [' file ']//gets the file value of the playlist index as 0 item
Jwplayer (). GetWidth () Jwplayer (). GetHeight ()//width-height
Jwplayer (). GetState ()//state value: 1.playing playback 2.paused Stop 3.idle idle 4. Completed end
Jwplayer (). Getduration ()//time required for video playback to end
Jwplayer (). Getvolume ()//sound size
Load Playlist
var playlist = new Array (
{file: "Video/123.mp4", Image: "Images/videoimg1.jpg"},
{file: "video/234.flv", Image: "Images/videoimg1.jpg"});
Jwplayer (0). Load (playlist);
Jwplayer (0). Playlistitem (1); Play a video labeled 1
Jwplayer (0). Playlistnext ();//Play Next Video
Jwplayer (0). Playlistprev ();//Play previous video
Jwplayer (0). Resize (width, height); Wide Height
Starting from (10-buffered seconds) seconds, the buffer (bufferlength) defaults to 3 seconds
Jwplayer (0). Seek (10);
events:{
OnComplete: function() {alert ("Play End!!!");},
Onvolume: function() {alert ("Sound size change!!!");},
Onready: function() {alert ("Ready!!!");},
Onplay: function() {alert ("Start playing!!!");},
OnPause: function() {alert ("Pause!!!");} --1
}
Jwplayer (0). OnPause: function() {alert ("Pause!!!");}//1 equivalent, execute 1 First
callback function
Jwplayer (0). Onbufferchange ( function() {alert ("Buffer change!!!");});
Jwplayer (0). Onbufferfull (function() {alert ("Video buffer complete!!!");});
Jwplayer (0). OnError (function(obj) {alert ("Player error!!!" +obj.message);})
Jwplayer (0). Onfullscreen (function(obj) {
if (Obj.fullscreen) {Alert ("full Screen");}
Else {alert ("not full Screen");}
});
Onmute (callback)//obj. Mute Mute
Onplaylist (function(obj) {//Video list loading complete
Alert (obj.playlist[0][' file ');
});
Onplaylistitem (callback)//starts to trigger obj when a video is played. Index for video indexing
Onready (callback)//Ready
OnResize (callback)//obj.width obj.height width height
Obj.oldstate value triggered when entering playback: From buffering pause state to playback state
Onplay (callback)
Enter Pause obj.oldstate value 1: Enter pause from playing buffering state
OnPause (callback)
Onbuffer (callback)//Enter load Obj.oldstate value playing, PAUSED or IDLE
OnIdle (callback)//Enter idle Obj.oldstate value playing, PAUSED or buffering.
OnComplete (callback)//End Play
Onvolume (callback)//obj.volume
JW Player Parameter Details