Slow and steady Silverlight (18)

Source: Internet
Author: User
Tags xmlns silverlight

Slow-play Silverlight (18)-2.0 video of the detailed MediaElement, develop a simple version of the full function player

Introduced

Silverlight 2.0 detailed MediaElement: Develop a simple version of the full-featured player

MediaOpened-Events that are triggered when the media is successfully opened

MediaFailed-Events that are triggered when the media fails to open successfully

currentStateChanged-Events that are triggered when the playback state (CurrentState) changes

DownloadProgressChanged-Events triggered when the download progress (downloadprogress) is changed

Mediaended-Events that are triggered when the media is played to the end

Bufferingprogresschanged-Events that trigger when a buffer progress (bufferingprogress) is changed

Source-the media address that needs to be played

Stretch-Stretch value

AutoPlay-whether to play the media automatically

CurrentState-Playback status

Position-The location of the media

Droppedframespersecond-the number of frames that the media is dropping per second

BufferingProgress-Buffering Progress

DownloadProgress-Download Progress

Naturalduration-Length of media file

Volume-Volume size

Balance-Volume balance

Bufferingtime-length of time needed for buffering

CurrentState-Playback status

Ismuted-Mute

Play ()-playing media

Pause ()-Pause media playback

Stop ()-stops playback of media

Online Demo

Http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html

Example

Videoplayer.xaml

<usercontrol x:class= "Silverlight20.Video.VideoPlayer"
Xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml" >
<stackpanel horizontalalignment= "Left" >

<!--
Source-the media address that needs to be played
Stretch-Stretch value [System.Windows.Media.Stretch enum]. See also: Shape/shape.xaml of this demo
AutoPlay-whether to play the media automatically
-->
<mediaelement x:name= "MediaElement"
Width= "height=" "200"
Source= "http://download.microsoft.com/download/2/0/5/205d8c39-3d55-4032-8195-7b0e6eda4cb6/ Winvideo-sl-installexperience.wmv "
Stretch= "Fill"
autoplay= "False" >
</MediaElement>

<button x:name= "Play" content= "playing" margin= "5" click= "Play_click"/>
<button x:name= "Pause" content= "suspend" margin= "5" click= "Pause_click"/>
<button x:name= "Stop" content= "stops" margin= "5" click= "Stop_click"/>
<button x:name= "Mute" content= "Mute" margin= "5" click= "Mute_click"/>

<slider x:name= "Playslider" minimum= "0" maximum= "1" margin= "5" tooltipservice.tooltip= "Play Progress" valuechanged= " Playslider_valuechanged "/>
<slider x:name= "Volumeslider" minimum= "0" maximum= "1" margin= "5" tooltipservice.tooltip= "Volume size" ValueChanged= " Volumeslider_valuechanged "/>
<slider x:name= "Balanceslider" minimum= "-1" maximum= "1" margin= "5" tooltipservice.tooltip= "Volume Balance" ValueChanged= " Balanceslider_valuechanged "/>

<textblock x:name= "Lblplaytime" margin= "5"/>
<textblock x:name= "Lblvolume" margin= "5"/>
<textblock x:name= "Lblbalance" margin= "5"/>

<textblock x:name= "Lbldownloadprogress" margin= "5"/>
<textblock x:name= "Lblbufferingprogress" margin= "5"/>
<textblock x:name= "Lbldroppedframespersecond" margin= "5"/>
<textblock x:name= "Lblstate" margin= "5"/>

<textblock x:name= "Lblwidth" margin= "5"/>
<textblock x:name= "Lblheight" margin= "5"/>
<textblock x:name= "Lbltotaltime" margin= "5"/>
<textblock x:name= "Lblbufferingtime" margin= "5"/>

</StackPanel>
</UserControl>

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.