The players we see on the web page are nothing more than WMP/RealOne/Macromedia Flash Player. The others are nothing more than different panels or other controls added. Some players installed on the computer are also integrated with encoding and decoder, and their core encoding and decoding technologies are the same. For example: the most popular windows media stream on the network (asf, wma, wmv format...), Real stream (rm, rmvb...), and MPEG series encoding formats (MP4/MP3 format...)
Windows Media Video is a streaming media format launched by Microsoft. It is extended to the upgrade of the ASF (Advanced Stream Format) format of its fellow students. With the same video quality, the WMV format is very small, so it is very suitable for online playback and transmission. Windows Media Player9 is compatible with all formats of WMV, and the official encoder is Windows Media Encoder, but if you want to convert high-quality wmv files, you must have super large memory to process the data...
I accidentally found that the CASTPOST player can define the size by itself. It can be said that it is fast enough for online playback in WMV format. Then I tried a lot of effort to put some wonderful short films and some classic MTV conversion WMV formats on it. Although it cannot be downloaded now, as long as there are not too many people connected, the playback is still very smooth ^_^
WMP has added ActiveX decoder controls, which can not only play music, but also play Flash and other video files.
The code copy is as follows:
<object align=center classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=196 height=196>
<param name=ShowStatusBar value=0>
<param name=Filename value=http://www.vevb.com/b.wmv>
<embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/con ... n/nsmp2inf.cab#Version=5,1,52,701 >
</embed>
</object>
If you want to play continuously with WMP, please refer to the ASX metafile usage explanation: Use ASX playlist
The player above is the old-fashioned, version 6.4! The new player appears after MediaPlayer9.0, which means that only players installed with 9.0 or above can be used normally.
Here is the new player code, which is much simpler than before:
The code copy is as follows:
<object id=player height=64 width=260 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6>
<param NAME=AutoStart VALUE=-1>
<!--Is it automatically played-->
<param NAME=Balance VALUE=0>
<!--Adjust the balance between left and right channels, the same as the old player code above-->
<param name=enabled value=-1>
<!--Is the player artificially controlled-->
<param NAME=EnableContextMenu VALUE=-1>
<!-- Whether to enable the context menu-->
<param NAME=url value=/blog/1.wma>
<!--played file address-->
<param NAME=PlayCount VALUE=1>
<!--Play times control, as integer-->
<param name=rate value=1>
<!--Play rate control, 1 is normal, decimals are allowed, 1.0-2.0-->
<param name=currentPosition value=0>
<!--Control settings: Current location-->
<param name=currentMarker value=0>
<!--Control Settings: Current Tag-->
<param name=defaultFrame value=>
<!--Show the default frame-->
<param name=invokeURLs value=0>
<!--Script command settings: Whether to call URL-->
<param name=baseURL value=>
<!--Script Command Settings: The URL to be called -->
<param name=stretchToFit value=0>
<!-- Whether to stretch in proportion-->
<param name=volume value=50>
<!--Default sound size is 0%-100%, 50%-->
<param name=mute value=0>
<!--Must or not->
<param name=uiMode value=mini>
<!--Player display mode: Full displays all; mini is the most simplified; None does not display playback control, only displays the video window; invisible does not display all-->
<param name=windowlessVideo value=0>
<!--If it is 0, full screen can be allowed, otherwise you can only view it in the window-->
<param name=fullScreen value=0>
<!--Is it automatic full screen to start playing?->
<param name=enableErrorDialogs value=-1>
<!--Whether to enable error prompt report-->
<param name=SAMIStyle value>
<!--SAMI style-->
<param name=SAMILang value>
<!--SAMI Language-->
<param name=SAMIFilename value>
<!--Subtitle ID-->
</object>
RealOne player code:
The code copy is as follows:
<object id=vid classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=427 height=300>
<param name=_ExtentX value=11298>
<param name=_ExtentY value=7938>
<param name=AUTOSTART value=-1>
<param name=SHUFFLE value=0>
<param name=PREFETCH value=0>
<param name=NOLABELS value=-1>
<param name=SRC value=rtsp://211.89.225.1/encoder/cnr3;>
<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> <object id=vid2 classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=427 height=30>
<param name=_ExtentX value=11298>
<param name=_ExtentY value=794>
<param name=AUTOSTART value=-1>
<param name=SHUFFLE value=0>
<param name=PREFETCH value=0>
<param name=NOLABELS value=-1>
<param name=SRC value=rtsp://211.89.225.1/encoder/cnr3;>
<param name=CONTROLS value=ControlPanel>
<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>
It looks a lot of complicated appearances, but in fact it has more player parameters, so you can do it...
Real Player Web Player Parameter Meaning
Parameters: autostart attribute: True or False Function: Specify whether the specified source file is automatically played.
Parameters: backgroundcolor Property: Any hexadecimal value starting with a symbol # or any predefined color function: Specify the background color of the image window
Parameter: center property: True or False Function: Specify that the fragment is played with the initial encoding size and is in the center of the image window.
Parameters: classid Property: clsid: CFCDAA03-8BE4-1lcf-B84B0020AFBBCCFA:** Function: Used to specify the unique string mark of the ActiveX control, and the embedded RealPalyer player can be recognized.
Parameters: console attribute: Any string function: Various RealPlayer controls can be gathered on a web page so that they can be used interactively or remain independent without affecting each other.
Parameters: controls Properties: ImageWindow, All, ControlPanel, PlavButton, PlayOnlyButton, PauseButton, StopButton, FFCtrl, RWCtrl, MuteCtrl, MuteVolume, VolumeSlider, PositionSlider, TACCtrl, HomeCtrl, InfoVolumePanel, InfoPanel, StatusBar, StatusField, PositionField Function: Let you specify which controls are visible.
Parameters: height attribute: Any integer value function: Specify the height of the RealPlayer element, unit: pixels
Parameters: id Attribute: Any string function: Specify a name for the RealPlayer element in the tag.
Parameters: imagestatus Property: True or False Function: Specify whether status information is displayed in the image window, the default value is true
Parameter: loop attribute: True or False Function: allows you to specify whether the fragment loops infinitely
Parameters: maintainaspect Property: True or False Function: Default RealPlayer stretches all fragments to fill the entire image window.
Parameter: name attribute: Any string function: Specify a name for the RealPlayer element in the tag (using id in the tag)
Parameters: nojava properties: True or False Function: Avoid starting Java virtual machine
Parameters: nolabels Attribute: True or False Function: It can prohibit the display of title or copyright information (if realplayer 5.0 or above, it is garbage...)
Parameters: nologo Attribute: True or False Function: Avoid display in the image window when RealPlayer is started
Parameters: numloop Attribute: Any integer value function: allows you to specify the number of times a file slice loop is not required.
Parameter: prefetch attribute: True or False Function: Specify whether RealPlayer can obtain stream description information before playback. The default value is False
Parameters: region property: Any string function: used with SMIL. Allows you to specify the use of HTML instead of SMIL
Parameters: scriptcallbacks Property: Comma-segment list function: Specify the browser's callback monitoring (What a high-end thing!)
Parameters: shuffle Attribute: True or False Function: Used with multiple file slices of ram files or SMIL files. You can make files in RealPlayer shuffle list
Parameters: src attribute: any legal relative or complete URL Function: Specify the address of the playback file or source file
Parameters: type attribute: string function: Specify the MIME type for the embedded plugin
Parameters: width attribute: Any integer value function: Specify the width of the RealPlayer element
Some functions, methods and procedures of RealPlayer
These are all functions and methods of Real Player ActiveX Control Library (Version 1.0). If you are interested, you can study it.
The code copy is as follows:
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 GetShowonmouseover 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;
Guide to using wmp video control in web pages
//wmplayer.controls.currentPosition = wmplayer.currentMedia.duration * (i / 100)
//
//
//
□Playing methods and properties
In addition to playing, pausing, and stopping, the media player also has the following properties:
Scanning-similar to the fast forward and fast inversion function of the video recorder;
Searching - Move directly to the specific stage time marked in the clip;
□Play
The media player provides two techniques to specify the media name (clip) to be played. 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 playing when the FileName property is set to the URL of the movie clip; otherwise the movie clip will not start playing unless you call the Play method. The Open method starts playing asynchronously, unlike the Play method, which does not start playing until other processes are finished.
The media player provides the following VCR-like properties and methods to control streaming media playback:
Play, Stop, Pause methods to start, stop, and pause streaming.
PlayCount property, sets the number of times the file is played.
AutoRewind property, determines whether to return to the beginning of the movie clip when the playback is stopped.
□Audio control
The media player provides the following properties to manage audio:
Balance attribute, determines the sound balance between left and right speakers;
Volume attribute, used to increase or decrease the volume;
Mute property, used to turn off or turn on sound;
※You can set the ShowAudioControls property to true to add controls to the control bar to process sounds.
□Scan
The media player provides the following properties for scanning:
FastForward method, fast forward;
FastReverse method, quickly turn it down;
Rate attribute, change the playback rate;
※To make movie clips scanned, the CanScan and AllowScan properties must be set to true.
□Search
The attributes used for search are:
MarkerCount property, refers to the total number of markers in the clip;
CurrentMaker, GetMarkerName, GetMarkerTime methods are used to return tag information;
MarkerHit event, triggered when a marker is encountered;
CurrentPosition property, the current position (measured in seconds), can be used to move the playhead to the specified point in the clip;
PositionChange event, triggered when the CurrentPosition property is set;
※To search for any time, the CanSeek attribute must be set to true. To search for marking points, the CanSeekToMarkers attribute must be set to true.
□Appearance interface of media player
In a web page, you can control which parts of the media player appear and which parts do not appear through relevant properties.
The media player includes the following elements:
Video Display Panel: Video Display Panel;
Video Border: Video border;
Closed Captioning Display Panel; subtitle display panel;
Track Bar; Search Bar;
Control Bar with Audio and Position Controls: Control bar with sound and position control;
Go To Bar: Go to the bar;
Display Panel: Display panel;
Status Bar: Status Bar;
The following attributes are used to determine which element to display:
ShowControls property: Whether to display the control bar (including playback controls and optional sound and position controls);
ShowAudioControls Properties: Whether to display sound controls (mute buttons and volume sliders) in the control bar;
ShowPositionControls property: Whether to display position controls in the control bar (including jump backward, rewind, fast forward, jump forward, preview each clip in the playlist);
ShowTracker property: Whether to display the search bar;
ShowDisplay attribute: Whether to display the display panel (used to provide information about programs and clips);
ShowCaptioning property: Whether to display the subtitle display panel;
ShowGotoBar property: whether to display Go to the bar;
ShowStatusBar property: Whether to display the status bar;
□Play list
The media player provides the following methods to access clips in a playlist:
Next method, skip to the next clip in the show (playlist);
Previous method, jump back to the previous clip in the show;
A feature of the media player is that it can preview every clip in the program, using the following properties:
PreviewMode property determines whether the media player is currently in preview mode;
CanPreview attribute determines whether the media player can be in preview mode;
In the windows media metafile, you can specify a preview time -PREVIEWDURATION for each clip. If not specified, the default preview time is 10 seconds.
You can also use Windows media metafiles to add watermarks and banners, and the metafiles also support gapless stream switching when inserting ads.
□Program information
Use the GetMediaInfoString method to return the following information about the relevant clip or program:
File name: File name
Title
Description: Description
Author: Author
Copyright: Copyright
Level: Rating
URLs: address of logo icon, watermark, banner
Clip information can be placed in media files, in Windows media metafiles, or both.
Clip information can be placed in media files, in windows media metafiles, or both. If clip information is specified in the metafile, the information in the metafile is returned by the GetMediaInfoString method, and the information contained in the clip will not be returned.
In the metafile, additional information can be placed in the PARAM tag of each clip or program. You can add as many PARAM tags to each clip to store custom information or link to related sites. Information in the PARAM tag can be accessed through 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 (seconds). To check whether this property contains a valid value, check the IsDurationValid property. (For broadcast videos, the length is unpredictable).