Collection of control parameters of Web player

Source: Internet
Author: User
Tags prefetch rewind shuffle
ArticleDirectory
    • Flash Player
    • Control Media Player

Flash Player

Insert the Flash Animation in the webpage and give it an ID variable, which is assumed to be "flashvar". Now you can use js to control the Flash Object as needed...

Document. Flash Object Name. Method Name ()
Document. Flash Object Name. Attribute

The above syntax applies to IE and Netscape browsers, but n6.0 and n6.01 do not support... the method for setting the object name is the same as that for IE, and for Netscape browsers, in addition to a name = "flashvar", a swliveconnect = "true ", never forget...

RoughCodeAs follows:
<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0"
Id = "flashvar" width = "500" Height = "100" name = "flashvar">
<Param name = movie value = "test.swf">
<Param name = Quality value = high>
<Param name = bgcolor value = # ffffff>
<Embed src = "test.swf" Quality = high bgcolor = # ffffff
Width = "500" Height = "100" name = "flashvar" type = "application/X-Shockwave-flash"
Pluginspage = "http://www.macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash "swliveconnect =" true ">
</Embed>
</Object>

Only Flash plug-ins are listed belowProgram(ActiveX Control) method, except JavaScript, other such as VB. c/C ++... these methods can also be used to control flash videos.

attribute:
play () // play a video
stopplay () // stop playing a video
rewind () // reverse the video to the first frame
gotoframe (frame number) // jump to the specified frame, from 0 to the last frame...
totalframes () // total number of frames returned to a movie
setvarivable ("variable name", "variable value") // set the variable value in the Flash video ..
setzoomrect (L, t, R, B) // enlarge the specified coordinate area (L = left; t = above; r = right; B = bottom ). please note that this axis unit is not the 72 dpi we are accustomed to, But 1440 DPI (known as twips ). so when you use this command to zoom in a part of the image, remember to multiply the coordinates by 20.

Zoom (percentage value) // specify the magnification as a percentage. O to restore to 100%. Otherwise, it is displayed as a 100/percentage value. If it is smaller than the original one, it will also be restored to 100%.
Pan (X, Y, mode) // pan the enlarged film...
Tplay ("video Instance name") // specifies the video instance for playing.
Tstopplay ("video Instance name") // stop the specified video instance.
Tgotoframe ("video Instance name", frame number) // specifies a video frame for playback.
Tgotolabel ("video Instance name", "frame volume name") // The video instance jumps to the specified frame (with a volume label)
Tsetproperty ("video Instance name", property number, property value) // sets a property value of a video instance. Use the property numbers such as 0, 1, 2 ....
Tgetproperty ("video Instance name", property number) // obtain a property value of a video instance using the property number, such as, 2 .....
Tcurrentframe ("video Instance name") // returns the current frame of the video instance...
Tcurrentlablel ("video Instance name") // The volume name of the frame where the video instance is located.
Loadmovie (Level number, "video path and file name") // flashvar. loadmovie (1, "test.swf"); loads "test.swf" to layer 1. to detach a newly loaded video, set the class number to an empty string, for example, flashvar. loadmovie ("", "test.swf ");
Isplaying () // test whether the video is playing. If yes, "true" is returned; otherwise, "false" is returned"
Percentloaded () // returns the percentage of data read from the browser by Shockwave Flash (0-100)
Getvariable ("variable name") // read the variable value in the video. If no value exists, null is returned.

Property number
When you use the flash plug-in to set or read a video attribute, you must use the codename as follows:

Description of property numbers
_ X 0 x coordinate
_ Y 1 y coordinate
_ XScale 2 vertical scaling ratio. 1 is equal proportion
_ Yscale 3 vertical scaling ratio. 1 is equal proportion
_ Currentframe 4 current frame
_ Totalframe 5 total frames
_ Alpha 6 Transparency
_ Visible 7 visibility
_ Width 8 width
_ Height 9 height
_ Rotation 10 Rotation Angle
_ Target 11 video instance path
_ Framesloaded 12 Number of currently loaded Frames
_ Name 13 name of the video instance
_ Droptarget 14: returns the name of the video instance encountered by the video.
_ URL 15 the video URL

Control Media Player

<Script language = "JavaScript">
Function straightplaystop (){
Player. Controls. Stop (); // stop
}
Function straightplayplay (){
Player. Controls. Play (); // play
}
</SCRIPT>

<Object ID = "Player" Height = "420" width = "620" classid = "CLSID: 6bf52a52-394a-11d3-b153-00c04f79faa6">
<Param name = "url" value = "">
<Param name = "rate" value = "1">
<Param name = "balance" value = "0">
<Param name = "currentposition" value = "0">
<Param name = "defaultframe" value>
<Param name = "playcount" value = "1">
<Param name = "autostart" value = "-1">
<Param name = "currentmarker" value = "0">
<Param name = "invokeurls" value = "-1">
<Param name = "baseurl" value>
<Param name = "volume" value = "50">
<Param name = "mute" value = "0">
<Param name = "uimode" value = "NONE">
<Param name = "stretchtofit" value = "0">
<Param name = "windowlessvideo" value = "0">
<Param name = "enabled" value = "-1">
<Param name = "enablecontextmenu" value = "-1">
<Param name = "fullscreen" value = "0">
<Param name = "samistyle" value>
<Param name = "samilang" value>
<Param name = "samifilename" value>
<Param name = "captioningid" value>
<Param name = "enableerrordialogs" value = "0">
<Param name = "_ CX" value = "6482">
<Param name = "_ CY" value = "6350">
</Object>

Player. settings. Volume volume (0-100)
Player. Controls. currentposition: returns the current time and position of the playback file (in seconds)

Player. Controls. currentposition: returns the current time and position of the playback file (in seconds)
Player. Controls. currentpositionstring string in time format "0: 32"
Player. currentmedia. Duration returns the total length of the playback file (in seconds)
Player. currentmedia. durationstring Time Format String "4: 34

 

<Object ID = "Player" Height = "64" width = "260" classid = "CLSID: 6bf52a52-394a-11d3-b153-00c04f79faa6">
<Param name = "autostart" value = "-1">
<! -- Automatic playback? -->
<Param name = "balance" value = "0">
<! -- Adjust the left-right channel balance and the old player code above -->
<Param name = "enabled" value = "-1">
<! -- Whether the player can be controlled by humans -->
<Param name = "enablecontextmenu" value = "-1">
<! -- Enable context menu -->
<Param name = "url" value = "/blog/1.wma">
<! -- Playback file address -->
<Param name = "playcount" value = "1">
<! -- Control the number of playbacks, which is an integer -->
<Param name = "rate" value = "1">
<! -- The playback speed is controlled. 1 is normal, and decimal places are allowed. -->
<Param name = "currentposition" value = "0">
<! -- Control settings: Current Position -->
<Param name = "currentmarker" value = "0">
<! -- Control settings: Current tag -->
<Param name = "defaultframe" value = "">
<! -- Display default frame -->
<Param name = "invokeurls" value = "0">
<! -- Script command setting: whether to call URL -->
<Param name = "baseurl" value = "">
<! -- Script command setting: called URL -->
<Param name = "stretchtofit" value = "0">
<! -- Scale up or not -->
<Param name = "volume" value = "50">
<! -- The default sound size is 0%-100%, and 50 is 50%. -->
<Param name = "mute" value = "0">
<! -- Mute or not -->
<Param name = "uimode" value = "mini">
<! -- Player display mode: full display all; Mini is the most simplified; none does not show the playback control, only the video window is displayed; invisible does not show all -->
<Param name = "windowlessvideo" value = "0">
<! -- If it is 0, full screen is allowed; otherwise, it can only be viewed in the window -->
<Param name = "fullscreen" value = "0">
<! -- Whether to enable automatic full screen playback -->
<Param name = "enableerrordialogs" value = "-1">
<! -- Enable error prompt report -->
<Param name = "samistyle" value>
<! -- Sami style -->
<Param name = "samilang" value>
<! -- Sami language -->
<Param name = "samifilename" value>
<! -- Subtitle id -->
</Object>

Meanings of Real Player webpage player Parameters

Parameter: autostart attribute: true or false: Specifies whether to automatically play the specified source file
Parameter: backgroundcolor attribute: Any hexadecimal value starting with the symbol "#" or any predefined color function: Specifies the background color of the image window.
Parameter: center attribute: true or false: specifies that the part is played with the initial encoding size in the center of the image window.
Parameter: classid property: "CLSID: CFCDAA03-8BE4-1lcf-B84B0020AFBBCCFA: ** function: Specifies the unique string identifier of the ActiveX control to recognize the embedded realpalyer player.
Parameter: Console attribute: any string function: Aggregates various RealPlayer controls on the webpage so that they can be used interactively or independently without affecting each other.
Parameters: Controls attributes: imagewindow, all, controlpanel, plavbutton, playonlybutton, pausebutton, stopbutton, ffctrl, rwctrl, mutectrl, mutevolume, volume, positionslider, tacctrl, homectrl, role, infopanel, statusbar, statusfield, and positionfield: You can specify the control that is visible.
Parameter: height attribute: any integer. It specifies the height of the RealPlayer element. Unit: pixel.
Parameter: Id attribute: any string. function: specify the name of the RealPlayer element in the tag.
Parameter: imagestatus attribute: true or false: determines whether to display status information in the image window. The default value is true.
Parameter: loop attribute: true or false. function: allows you to specify whether the part has an infinite loop.
Parameter: maintainaspect attribute: true or false: by default, RealPlayer can stretch all parts to fill the entire image window.
Parameter: Name attribute: any string. function: specify a name for the RealPlayer element in the tag (ID is used in the tag)
Parameter: nojava attribute: true or false. function: Avoid starting a Java VM.
Parameter: nolabels attribute: true or false: title or copyright information cannot be displayed (it is junk when realplayer5.0 or above ...)
Parameter: nologo attribute: true or false: prevents display in the image window during RealPlayer startup
Parameter: numloop attribute: any integer function: enables you to specify the number of file loop times without the parameter loop.
Parameter: prefetch attribute: true or false: Specifies whether RealPlayer can obtain stream description information before playback. The default value is false.
Parameter: Region property: any string used together with SMIL. Allow you to specify HTML to replace smil
Parameter: scriptcallbacks attribute: A list separated by commas (,). It specifies the browser's callback monitoring (Advanced !)
Parameter: shuffle attribute: true or false: used together with a multi-file RAM file or SMIL file. Allows RealPlayer To Play files in the list randomly.
Parameter: src attribute: Any legal relative or complete URL function: Specifies the address of the playback file or source file.
Parameter: Type attribute: String function: Specify the MIME type for the embedded plug-in
Parameter: width attribute: any integer. function: Specify the width of the RealPlayer element.

The attribute meaning of controls...

Component: imagewindow
Role: video display area

Component: All
Purpose: Embed all buttons, slide bars, and information panels of realplaver.

Component: controlpanel
Purpose: display all the control buttons, as well as the position slide and speaker icons, and the slide for adjusting the sound size.

Component: playbutton
Purpose: display the play and pause buttons.

Component: playonlybutton
Purpose: only display the playback button.

Component: pausebutton
Purpose: only the pause button is displayed.

Component: stopbutton
Purpose: only the stop button is displayed.

Component: ffctrl
Purpose: only display the fastforward button

Component: rwctrl
Purpose: only display the rewind button

Component: mutectrl
Purpose: display only the speaker icon and use it as the mute button.

Component: mutevolume
Purpose: display the small speaker icon (for Mute) and the slider on it for adjusting the volume

Component: volumeslider
Purpose: only display the vertical volume slide

Component: positionslider
Purpose: Display horizontal sliding bars

Component: tacctrl
Purpose: display the horizontal message box with title, author, and copyright information displayed in turn.

Component: homectrl
Purpose: display a small real ID

Component: infovolumepanel
Purpose: display the black message box. The title, author, and copyright information are displayed in green. The speaker icon and sound adjustment slide are displayed on the right hand side.

Component: infopanel
Role: Same as above, but no mute button or sound adjustment slide

Component: statusbar
Purpose: display the horizontal message box, including the part information, such as the part time and network status.

Component: statusfield
Function: similar to statusbar, but only displays the message area and network messages, for example, "re-buffenng ..."

Component: positionfield
Function: a small black message box that displays the length of the entire file segment and the position of the current frame in the segment.

Embedded RealOne Player
<Object ID = "rplayer" classid = "CLSID: CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" Height = "100%" width = "100%">
<Param name = "_ extentx" value = "23627">
<Param name = "_ extenty" value = "15187">
<Param name = "autostart" value = "-1">
<Param name = "Shuffle" value = "0">
<Param name = "prefetch" value = "0">
<Param name = "nolabels" value = "0">
<Param name = "src" value = "http://www.blogerhome.com/address.asp? Num = 24009987 & id = 10019 ">
<Param name = "controls" value = "imagewindow">
<Param name = "console" value = "clip1">
<Param name = "loop" value = "0">
<Param name = "numloop" value = "0">
<Param name = "center" value = "0">
<Param name = "maintainaspect" value = "0">
<Param name = "backgroundcolor" value = "#000000">
</Object>
Embedded mediaplayer player
<Object ID = "mediaplayer" width = "478" Height = "300" codebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.
Cab # version = 6, 1, 5,217 "type =" application/X-oleobject "standby =" loading Microsoft Windows Media Player components... "classid =" CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95 "viewastext>
<Param name = "displaybackcolor" value = "0">
<Param name = "displayforecolor" value = "16777215">
<Param name = "displaymode" value = "0">
<Param name = "displaysize" value = "-1">
<Param name = "FILENAME" value = "MMS: // www.webjx.com/video file .wmv">
<! -- Set the connection of the video to be played here -->
<Param name = "showcontrols" value = "0">
</Object>

RealPlayer functions, methods, and processes

This is all functions and methods of Real Player ActiveX control library (version 1.0). If you are interested, please study them.

Function getsource: widestring;
Procedure setsource (const lpsznewvalue: widestring );
Function getconsole: widestring;
Procedure setconsole (const lpsznewvalue: widestring );
Function getcontrols: widestring;
Procedure setcontrols (const lpsznewvalue: widestring );
Function getnolabels: wordbool;
Procedure setnolabels (bnewvalue: wordbool );
Function getautostart: wordbool;
Procedure setautostart (bnewvalue: wordbool );
Function getautogotourl: wordbool;
Procedure setautogotourl (bnewvalue: wordbool );
Function getvolume: smallint;
Procedure setvolume (nvol: smallint );
Function getmute: wordbool;
Procedure setmute (bmute: wordbool );
Function getloop: wordbool;
Procedure setloop (bval: wordbool );
Function getimagestatus: wordbool;
Procedure setimagestatus (benable: wordbool );
Function getpacketstotal: integer;
Function getpacketsreceived: integer;
Function getpacketsoutoforder: integer;
Function getpacketsmissing: integer;
Function getpacketsearly: integer;
Function getpacketslate: integer;
Function getbandwidthaverage: integer;
Function getbandwidthcurrent: integer;
Procedure doplaypause;
Procedure dostop;
Procedure donextitem;
Procedure doprevitem;
Function canplaypause: wordbool;
Function canstop: wordbool;
Function hasnextitem: wordbool;
Function hasprevitem: wordbool;
Function hasnextentry: wordbool;
Function haspreventry: wordbool;
Procedure donextentry;
Procedure dopreventry;
Procedure aboutbox;
Procedure editpreferences;
Procedure hideshowstatistics;
Function isstatisticsvisible: wordbool;
Procedure dogotourl (const URL: widestring; const target: widestring );
Procedure doplay;
Procedure dopause;
Function getposition: integer;
Function getplaystate: integer;
Function getlength: integer;
Function gettitle: widestring;
Function getauthor: widestring;
Function getcopyright: widestring;
Function getclipwidth: integer;
Function getclipheight: integer;
Function canplay: wordbool;
Function canpause: wordbool;
Procedure setposition (lposition: integer );
Function getnumloop: integer;
Procedure setnumloop (lval: integer );
Function getcenter: wordbool;
Procedure setcenter (bval: wordbool );
Function getnologo: wordbool;
Procedure setnologo (bval: wordbool );
Function getmaintainaspect: wordbool;
Procedure setmaintainaspect (bval: wordbool );
Function getbackgroundcolor: widestring;
Procedure setbackgroundcolor (const pval: widestring );
Function getstereostate: wordbool;
Function getlivestate: wordbool;
Function getshowstatistics: wordbool;
Procedure setshowstatistics (bval: wordbool );
Function getshowpreferences: wordbool;
Procedure setshowpreferences (bval: wordbool );
Function getshowabout: wordbool;
Procedure setshowabout (bval: wordbool );
Function getoriginalsize: wordbool;
Procedure setoriginalsize;
Function getdoublesize: wordbool;
Procedure setdoublesize;
Function getfullscreen: wordbool;
Procedure setfullscreen;
Function getenablecontextmenu: wordbool;
Procedure setenablecontextmenu (bval: wordbool );
Function getenableoriginalsize: wordbool;
Procedure setenableoriginalsize (bval: wordbool );
Function getenabledoublesize: wordbool;
Procedure setenabledoublesize (bval: wordbool );
Function getenablefullscreen: wordbool;
Procedure setenablefullscreen (bval: wordbool );
Function getenablemessagebox: wordbool;
Procedure setenablemessagebox (bval: wordbool );
Procedure settitle (const pval: widestring );
Procedure setauthor (const pval: widestring );
Procedure setcopyright (const pval: widestring );
Function getwantkeyboardevents: wordbool;
Procedure setwantkeyboardevents (bwantsevents: wordbool );
Function getwantmouseevents: wordbool;
Procedure setwantmouseevents (bwantsevents: wordbool );
Function getnumentries: smallint;
Function getcurrententry: smallint;
Function getentrytitle (uentryindex: smallint): widestring;
Function getentryauthor (uentryindex: smallint): widestring;
Function getentrycopyright (uentryindex: smallint): widestring;
Function getentryabstract (uentryindex: smallint): widestring;
Procedure setcanseek (bcanseek: wordbool );
Function getcanseek: wordbool;
Function getbufferingtimeelapsed: integer;
Function getbufferingtimeremaining: integer;
Function getconnectionbandwidth: integer;
Function getpreferedlanguagestring: widestring;
Function getpreferedlanguageid: integer;
Function getusercountryid: integer;
Function getnumsources: smallint;
Function getsourcetransport (nsourcenum: smallint): widestring;
Function getwanterrors: wordbool;
Procedure setwanterrors (bval: wordbool );
Function getshuffle: wordbool;
Procedure setshuffle (bval: wordbool );
Function getversioninfo: widestring;
Function getlastmessage: widestring;
Function getlasterrorseverity: integer;
Function getlasterrorrmacode: integer;
Function getlasterrorusercode: integer;
Function getlasterroruserstring: widestring;
Function getlasterrormoreinfourl: widestring;
Procedure setprefetch (bval: wordbool );
Function getprefetch: wordbool;
Procedure setregion (const pval: widestring );
Function getregion: widestring;
Function getisplus: wordbool;
Function getconsoleevents: wordbool;
Procedure setconsoleevents (bval: wordbool );
Function getdrminfo (const pval: widestring): widestring;
Property controlinterface: irealaudio read getcontrolinterface;
Property defaultinterface: irealaudio read getcontrolinterface;

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.