Complete video playback code inserted into the webpage _ MySQL

Source: Internet
Author: User
Tags prefetch
Complete video playback code insertion on a webpage 1. avi format
The code snippet is as follows:














2. mpg format
The code snippet is as follows:





























3. smi format
The code snippet is as follows:














4. rm format
The code snippet is as follows:















5. wmv format
The code snippet is as follows:



















6.wma format
Put in. Some explanations are as follows:










7. Windows Media Player Series (different panel styles)
Comprehensive:
Id = MediaPlayer type = application/x-oleobject width = 210 height = 340 standby = "Loading Microsoft Windows Media Player components..." VIEWASTEXT align = MIDDLE>


























































Simple:

Tag type:

Reference content
Media Player appearance interface
On the webpage, you can use relevant attributes to control which parts of the media player appear and which parts do not appear.
Media players include the following elements:
Video Display Panel: the 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 attribute: whether to display the control bar (including the playback control and optional sound and position control );
ShowAudioControls properties: whether to display the sound control (mute button and volume slider) in the control bar );
ShowPositionControls attribute: whether to display the position control in the control bar (including backward jump, fast back, fast forward, forward jump, preview each clip in the playback list );
ShowTracker property: whether to display the search bar;
ShowDisplay attribute: whether to display the display panel (used to provide program and clip information );
ShowCaptioning attribute: whether to display the subtitle display panel;
ShowGotoBar attribute: whether to show and go to the bar;
ShowStatusBar attribute: whether to display the status bar;

□Playlist
The media player provides the following methods to access the clips in the playlist:
Next method, jump to the Next clip in the program (playlist;
The Previous method jumps back to the Previous clip in the program;
One feature of a media player is to preview every clip in a program using the following attributes:
The PreviewMode attribute determines whether the media player is in preview mode;
The CanPreview attribute determines whether the media player is in preview mode;
In the windows Media element file, you can specify the preview time-PREVIEWDURATION for each clip. if not, the default preview time is 10 seconds.
You can also use the Windows Media meta file to add watermarks and banners. the meta file also supports non-gap stream switching when inserting advertisements.

□Program information
You can use the GetMediaInfoString method to return the following information about related clips or programs:
File name: File name
Title: Title
Description: Description
Author: Author
Copyright: Copyright
Level: Rating
URLs: logo icon, watermark, banner Address
Editing information can be stored in a media file, a Windows Media meta file, or both. If the Clip information is specified in the Metafile, the information in the Metafile is returned using the GetMediaInfoString method, instead of the information contained in the clip.
In the Metafile, additional information can be placed in the PARAM tag of each clip or program. You can add any number of PARAM tags for each clip to store custom information or link to related sites. The information in the PARAM tag can be accessed using the GetMediaParameter method.
The following attributes return information about the size and time:
ImageSourceHeight and ImageSourceWidth: return the display size of the image window;
Duration attribute. the length of the clip (in seconds) is returned. to check whether this attribute contains valid values, check the IsDurationValid attribute. (The length of a broadcast video is unpredictable ).

□Subtitle
You can use the. smi file to add subtitles for your program. Media players support the following attributes to process subtitles:
SAMIFileName attribute, specifying the name of the. smi file;
SAMILang attribute, specify the subtitle language (if not specified, use the first language );
Specifies the subtitle text size and style;
The ShowCaptioning attribute determines whether to display the subtitle display panel;

□Script command
With audio and video streams, you can add script commands to streaming media files. The script command is a multi-to-Unicode string that synchronizes time with a specific time in a multimedia stream. The first string identifies the type of the command to be issued, and the second string specifies the command to be executed.
When streaming is placed at a script-related time, the control will send a ScriptCommand event to the webpage, and then the event processing process will respond to the event. The script command string is passed to the event processor as a parameter of the script command event.
The media player automatically processes the following types of embedded script commands:
1) URL-based command: when the media player control receives a URL-based command, the specified URL will be loaded to your default browser. If the media player is embedded in an HTML file with frame separation, the URL page can be loaded into the frame specified by the script command. If the script command does not specify a frame, the DefaultFrame attribute determines which frame the URL page is loaded.
You can set the InvokeURLs attribute to determine whether to automatically process URL-type script commands. If the value of this attribute is false, the media player control ignores URL commands. However, the script command event will still be triggered, which allows you to selectively process URL-type commands.
The URL command specifies the relative address of the URL. The base address is specified by the BaseURL attribute. The command parameter of the script command event sent by the media player control is the link address.
2) FILENAME command: when the media player control receives a FILENAME command, it sets the FileName attribute to the file provided by the script command, and then the media player starts playing the file. Media Player controls always process FILENAME commands automatically. Unlike URL commands, they cannot be disabled.
3) TEXT command: when the media player control receives a TEXT command, it displays the command content in the control's subtitle window. The content can be plain text or HTML.
4) EVENT-type command: when the media player control receives an EVENT-type command, it searches for the NAME attribute of the EVENT element in the media element file. If the NAME attribute matches the second string in the script command, the media player control executes the entries 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 element file and opens the matched title, but does not play the video, wait until you receive the real EVENT with the same name from the EVENT command.

□Capture keyboard and mouse events
The EnableContextMenu and ClickToPlay attributes provide users with methods to operate in the image window.
If the EnableContextMenu attribute is true, right-click the image window to open the association menu. if the ClickToPlay attribute is set to true, you can click the image window to switch between playing and pausing.
To receive mouse movement and click events, set the SendMouseMoveEvents and SendMouseClickEvents attributes to true. Mouse events include:
MouseDown, which is generated when you press the mouse;
MouseUp, generated when the user releases the mouse;
MouseMove, generated when the user moves the mouse;
Click, which is generated when you Click the mouse button on the media player;
DbClick, which is generated when you double-click the mouse button on the media player;
To receive keyboard events, set the SendKeyboardEvents attribute to true. Keyboard events include:
KeyDown, generated when the user presses the next key;
KeyUp, generated when the user releases a key;
KeyPress, generated when the user presses and releases a key;

□Monitoring stream status and network connection
Flow status attributes include:
PlayState: playback status;
OpenState: open;
Bandwidth: Bandwidth;
Supported events include:
OpenStateChange: changes the open status (triggered only when the SendOpenStateChangeEvents attribute is true)
PlayStateChange: changes the playback status (triggered only when the SendPlayStateChangeEvents attribute is true)
EndOfStream: triggered when the stream ends;
NewStream: triggered when a new stream is opened;
Network receiving attributes include:
Predictionquality: receiving quality;
ReceivedPackets: received packages;
LostPackets: The Lost package;
Monitoring buffer attributes include:
BufferingTime: buffer time;
BufferingCount: Buffer count;
BufferingProgress: Buffer process;
Buffering: Buffering events;

□Error handling
Media Player provides the built-in error handling function-displaying error messages in the dialog box or status bar. In addition, you can add an error handler by yourself. If the SendErrorEvents attribute is set to true, the error box is not displayed, but an error event is sent. if the SendErrorEvents attribute is set to false, the error box is displayed, but an error event is sent.
Media Player supports the following error handling events:
An Error occurs when a dangerous Error occurs;
A Warning event indicates a non-dangerous error;
When your application receives an error event, you can check the following attributes to determine the specific error message:
HasError: checks whether the current media player has an error;
ErrorCode: provides the code value related to this type of error;
ErrorDescription: provide the error description;
ErrorCorrection: specifies the media player to correct errors of this type;

□Play CD
Media players regard CD as a single audio stream (marked at the beginning of each audio track. To use CD in a webpage, you must set the FileName attribute to CDAUDI with a colon as follows:

CD Audio Playback Example

CLASSID = "CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95"
WIDTH = "320"
HEIGHT = "508"
STYLE = "position: absolute; left: 0px; top: 70px;">








Then you can use the Play method to Play the CD.
You can specify the playing sequence and information of each audio track in the windows Media element file. Example:


CD Audio with the Media Player
Windows Media Technologies
(C) 1999, Microsoft, Inc.


Track 1: Title 1




Track 2: Title 2




Track 3: Title 3




Track 4: Title 4



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.