Web page player code complete works

xiaoxiao2021-03-17  195

Here mainly lists the web player of MediaPlayer and RealPlayer and code of common formats, and other commonly used code is also introduced in the end of the article.

1. Avi format code pieces are as follows: 2. MPG format code pieces are as follows: <

Param name = "allowHideControls" value = "- 1"> < Param name = "nolabels" value = "- 1">

4.RM format code pieces are as follows:

5.WMV format code pieces are as follows:

6. WMA format is placed in . Below is part of the explanation:

7.Windows Media Player Series (Different panel patterns) integrated: < param name = ClickToPlay value = 0>

Invokeurls value = -1> < / EMBED> tag type:

Multifunctional ◇ Not only can you put a recall, but also put Flash and other video files.

Windows Media Player Web Player Parameter Meaning

(Default 0 is whether -1 or 1 is Yes)

Value = "- 1"> < Param name = "selectstart" value = "- 1"> <

Param name = "sendplayStateChangeevents" value = "- 1"> on this broadcast The device is the kind of vintage, version 6.4! The new player is in MediaPlayer9.0, which means that only a player loaded with 9.0 or 9.0 or more can be used normally.

-------------------------------------------------- -----------------------------

Below is a new player code, relatively simple in the previous: < Param name = "autostart" value = "- 1"> < Param name = "uimode" value = "mini"> <

! - If 0 can allow full screen, otherwise you can only view in the window-> Real Player Web Player Parameter Meaning

/ / Define Play Interface LitPlay.Text = ""; LitPlay.Text = " "; LitPlay.Text =" "; litplay.text =" " LPlay.text = ""; LitPlay.Text = "";

// Define status bar LitPlay.Text = ""; LitPlay.Text = " "; LitPlay.Text =" "; LitPlay.Text =" ";

/ / Define Control Panel LitPlay.Text = ""; LitPlay.Text = " "; LitPlay.Text =" ; litplay.text = " "; Litplay.text =" "; litplay.text =" "; litplay.text =" < Param name = 'loop' value = '0'> "; litplay.text =" "; LitPlay.Text =" ";

Parameters: Autostart Properties: True or false effect: Specifies whether to automatically play the specified source file parameters: BackgroundColor property: Any 16-en-defined colors that start with symbol "#" or any predefined color effect: Specify the background window Color Parameters: Center Properties: True or false effect: Specifies the disconnection to play with the initial coding size and in the center of the image window. Parameters: ClassID Property: "CLSID: CFCDAA03-8BE4-1LCF-B84B0020Afbbcccfa: ** Run: Used to specify unique string labels of ActiveX controls, you can recognize embedded REALPAL players. Parameters: console properties: any string role : You can get a variety of different RealPlayer controls on the web, so they can use or remain independent, and they do not affect parameters: Controls properties: ImageWindow, All, ControlPanel, Plavbutton, PlayonlyButton, Pausebutton, StopButton, FfCtrl, Rwctrl , MuteCtrl, MuteVolume, VolumeSlider, PositionSlider, TACCtrl, HomeCtrl, InfoVolumePanel, InfoPanel, StatusBar, StatusField, PositionField effect: allows you to specify those controls are visible parameters:. height property: any integer value effect: the height of the specified RealPlayer elements, Unit: Pixel Parameters: ID Property: Any string effect: Specify names for the RealPlayer element in the tag. Parameters: imageStatus Properties: True or false effect: Specify whether to display status information in the image window, the default value is true: loop Property: True or false effect: Allows you to specify if the snippet is infinite loop parameters: maintainaspect property: True or false effect: Default RealPlayer stretches all pieces to full image window.

Parameters: Name Properties: Any string role: Specify names for RealPlayer elements in the tag (using ID) parameters: Nojava property: True or false: Nolabels Properties: True or False Role: You can disable the title or copyright information (RealPlayer5.0, it is a trash ...) Parameters: NOLOGO properties: True or false effect: Avoid RealPlayer When you display parameters in the image window: NUMLOOP Properties: Any Integer value: Let you specify the number of file card loops, no parameters loop parameter: True or false effect: Specify if the RealPlayer can get the stream description information before playback, the default value is false Parameters: Region properties : Any string role: use with SMIL. Allow you to specify using HTML instead of SMIL parameters: ScriptCallbacks Properties: Use a comma-split list: Specify the browser's callback monitor (good high-end stuff!) Parameters: shuffle property: True or false effect: RAM of the same multi-file The file or the SMIL file is used together. Enables the file parameters in the REALPLAYER random play list: SRC attribute: Any legal opposite or complete URL role: Specify the played file or the address parameter of the source file: Type property: String effect: Specify the MIME type for embedded plugins Parameters: Width Properties: Any integer value: Specifies some of the REALPLAYER elements Some functions, methods, and processes

This is all functions and methods of Real Player ActiveX Control Library (Version 1.0), interested in study.

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 GetBandwidthaverage: Intege r; 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 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 SetFullsc reen; 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 Get LastErrorSeverity: 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; page WMP video control of user's guidance

□ Playback method and attribute except for play, pause, stop, the media player can also use the following attribute: Scanning - similar to the recorder's fast forward filling function; Search - Move directly to the clip Specific performance time; □ Playing media player provides two techniques to specify the media name (clip) to play, you can set the filename property, or call the OPEN method. If the value of the autostart property is True, the movie clip will start playback when the FileName property is set to the URL of the movie clip; otherwise the movie clip does not start playing unless you call the Play method. The Open method starts playback is asynchronous, it is not like the Play method to wait until the end of the other process, start playing. The media player provides the properties and methods of the following similar recorders to control the playback of streaming: Play, STOP, PAUSE method, start, stop, suspend streaming media. Playcount properties, set the number of files played. Autorewind property determines whether or not to return to the beginning of movie clips when playing.

□ Audio Control Media Player provides the following properties to manage audio: Balance property, determine the sound balance of the left and right speakers; the Volume property is used to increase the volume; the MUTE property is used to close or open the sound; ※ you can The ShowAudioControls property is set to True to add controls that handle the sound in the control bar.

□ Scanning Media Player provides the following properties to scan: Fastforward method, fast forward; fastreverse method, fast down; rate property, change the play rate; ※ To make the movie clip can be scanned, you must set up the Canscan and the AllowScan property. True.

□ Search for the properties of the search: markercount properties, the total number of tags in the clips; CurrentMaker, getMarkername, getMarkertime method, used to return tag information; MarkerHit event, trigger when you encounter tags; CurrentPosition properties, current location Spond degree), can be used to move the play head to the point specified in the clip; PositionChange event, trigger when setting the currentPosition property; ※ To search any time, you must set the canseek property to true, you want to search the tag point You must set the CanseekTomarkers property to True.

□ The appearance interface of the media player is in the web page, you can control which parts of the media player through related properties, which are not. Media player includes the following elements: Video Display Panel; Video Border: Video Border; Closed Captioning Display Panel; Subtitled Display Panel; Track Bar; Search Column; Control Bar With Audio and Position Controls: Sound and Location Control Control bar; go to bar: Go to the column; display panel: display panel; Status bar: status bar; the following properties are used to determine which element: showControls property: Whether to display the control bar (including play control and optional Sound and location controls); ShowAudioControls properties: Whether to display sound controls (mute buttons and volume slits) in the control bar; showPositionControls attribute: Do you display location controls in the control bar (including backward, backward, fast forward, forward Jump, preview each clip in the playlist; showTracker property: Whether to display a search bar; showdisplay property: Whether to display the display panel (for information to provide the program and clip); showcaption property: Whether to display the subtitle display panel; showgotobar properties : Whether to display the column; showstatusbar attribute: Whether the status bar is displayed; □ Playl Media Player provides the following method to access the editing in the playlist: Next method, jump to the next clip in the program (playlist); Previous Method, jump back to the previous clip in the program; a characteristic of the media player is able to preview each of the program, using the following attribute: previewMode property, determine if the media player is currently in preview mode; canpreView property, determine the media Whether the player can be in a preview mode; in the Windows Media meta file, you can specify a preview time for each clip. If you don't specify, the default preview time is 10 seconds. You can also add Watermarks with Banners in Windows Media meta files, and the meta file also supports no gap flow switching when inserted into the ad.

□ program information using GetMediaInfoString method to return the relevant clip or program the following information: File name: File name Title: Title Description: Description Author: Author Copyright: Copyright level: Rating URLs: logo icon, watermark, banner address clip information can be released In the media file, you can also put it in a Windows media meta file, or both. If the clip information is specified in the meta file, the information returned by the getMediaInfostring method is the information in the meta file without returning the information contained in the clip. In the meta file, additional information can be placed in each clip or program's Param tab. You can add any multiple param tags to each clip to store custom information or link them to the relevant site. Information in the Param tag can be accessed via the getMediaParameter method. The following properties return information about size and time: ImageSourceHeight, ImageSourceWidth: Returns the display size of the image window; DURATION property, returns the length of the clip (second), to detect if this property contains a valid value, check the isdurationvalid property. (For broadcast video, its length is unpredictable). □ Subtitles You can use the .smi file to add subtitles for your program. The media player supports the following properties to handle subtitles: SamiFileName properties, specify the name of the .smi file; Samilang property, specify the language of the subtitle (use the first language); SAMISTYLE property, the text size and style of the specified subtitle The showcaptioning property determines whether the subtitle display panel is displayed;

□ Script command accompanying audio, video stream, you can join the script command in the streaming media file. The script command is a multi-purpose Unicode string synchronized with a specific time in the multimedia stream. The first string identifies the type of command to be commanded, and the second string specifies the command to be executed. When the current is played to the script-related time, the control sends a ScriptCommand event to the web page and then responds to this event by the event processing process. The script command string will be passed to the event processor as the parameters of the script command event. The media player automatically processes the following types of embedded script commands: 1) URL type command: When the media player control receives a URL type command, the specified URL will be loaded to the user's default browser. If the media player is embedded in an HTML file of a divided frame, the URL page can be loaded into the frame specified by the script command. If the script command does not specify a frame, which frame will be decided by the defaultframe attribute to install the URL page. You can decide if the URL type script command is automatically processed by setting the InvokeURLS property. If the value of this attribute is false, the media player control will ignore the URL command. But the script command event will still trigger, which allows you to select the URL command. The URL command is specified as the relative address of the URL. The base address is specified by the baseURL property. The command parameters of the script command events transmitted by the media player control are the link good address. 2) Filename type command: When the media player control receives a filename type command, it sets the filename property as the file provided by the script command, and the media player will open this file to start playing. The media player control is always automatically handled, which is not impedably from the URL type command. 3) TEXT type command: When the media player control receives a Text type command, it displays the contents of the command in the subtitle window of the control. The content can be plain text or HTML. 4) EVENT command: When the media player control receives an EVENT type command, it searches for the Name property of the EVENT element in the media meta file. If the Name property matches the second string in the script command, the media player control executes an entry contained in the Event element. 5) OpenEvent type command: When the media player control receives an OpenEvent type command, it checks the EVENT element in the media meta file and opens the matching title, but does not play until it receives the same name from the Event type command. Real events.

□ Capture the keyboard and mouse event EnableContextMenu and Clicktoplay properties provide users with ways to operate on image windows. If the EnableContextMenu property is True, right-click the mouse on the image window to open the associated menu, if the ClicktOPlay property is set to TRUE, the user can click on the image window to play with pause. To receive mouse movements and click events, set the SendMouseMouseEvents and SendMouseClicKevents properties to True. The mouse event is: mousedown, when the user is generated when the user is pressed; Mouseup, when the user releases the mouse; MouseMove, when the user moves the mouse; Click, when the user is generated when the user is clicked on the media player; dbclick, When the user doubles the mouse button on the media player; if you want to receive the keyboard event, set the SendKeyboardEvents property to True. Keyboard events are: keydown, when the user presses a button; keyup PlayState: play status; OpenState: open; Bandwidth: Bandwidth; support of events: OpenStateChange: open to change (triggered only when SendOpenStateChangeEvents property is true) PlayStateChange: playing status change (triggered only when SendPlayStateChangeEvents property is true) EndOfStream : Trigger at the end of the stream; NewStream: Trigger when opening new flow; network reception attribute includes: receptionQuality: ReceiveQuality: ReceiveDPackets: The package already received; LostPackets: Lost package; monitor buffer properties: bufferingTime: buffer time; bufferingcount : Buffering times; bufferingProgress: buffer process; buffering: buffer event;

□ Error Handling Media Player provides built-in error handling feature - displays error messages in the dialog or status bar. In addition, you can add an error handler yourself. If the senderRREvents property is set to true, the error box will not be displayed, but an error event will be sent; if the senderRorEvents property is set to false, the error box will be displayed, but an error event is sent. The media player supports the following error handling event: Error event, refers to the hazardous error occurrence; Warning event refers to an unhaneous error; when your application receives an error event, you can detect the following properties Determine specific error message: Haserror: Checks the current media player has an error; ErrorCode: ErrorDescription: ErrorDescription: Provides error description information; errorCorRection: Specifies the media player to make this type of error Correction; □ Play the CD Media Player to view the CD as a single audio stream with a marked at the beginning of each track. To use a CD in a web, you need to set the filename property to CDAUDIO:, you must have a colon, as shown below: cd Audio Playback Example </ title> </ head> <body> <Object id = "MediaPlayer" classid = "CLSID: 22D6F312-B0F6-11D0-94AB-0080C74C7E95" width = "320" Height = "508" style = "Position: absolute; left: 0px; Top: 70px;"> < Param name = "filename" value = "cdaudio:"> <param name = "autostart" value = "0"> <param name = "showcontrols" value = "1"> <param name = "showstatusbar" value = "1 "> <Param name =" showdisplay "value =" 1 "> </ Object> </ body> </ html> You can play CD with a Play method. You can specify the play order and each track information in the Windows Media meta file. Examples are as follows:</p> <p><Asx version = "3.0"> <title> CD Audio with the Media Player </ title> <author> Windows Media Technologies </ author> <copyright> (c) 1999, Microsoft, Inc. </ Copyright></p> <p><Entry> <title> TRACK 1: title 1 </ title> <ref href = "cdaudio:" /> <endmarker number = "1" /> <endmarker number = "2" /> </ entry> <entry> <Title> TRACK 2: Title 2 </ title> <ref href = "cdaudio:" /> <startmarker number = "2" /> <endmarker number = "3" /> </ entry></p> <p><Entry> <title> TRACK 3: title 3 </ title> <ref href = "cdaudio:" /> <startmarker number = "3" /> <endmarker number = "4" /> </ entry></p> <p><Entry> <title> TRACK 4: title 4 </ title> <ref href = "CDAUDIO:" /> <startmarker number = "4" /> </ entry> </ asx></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-129682.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="129682" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.046</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '7Lm9dhx0S23DZjhtmGo9hf5XAN85uZT14xJ9C2MICiY9VZ8hoSobz24jUzpIAkq8Tc3xjxYXr6Mv7EZrWG_2Batw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>