SmoothStreamingMediaElement Class
Represents a media player that provides MediaElement capabilities and advertising integration. The class is designed to support Smooth Streaming.
Inheritance Hierarchy
System.Object
System.Windows.DependencyObject
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
Microsoft.Web.Media.SmoothStreaming.SmoothStreamingMediaElement
Namespace: Microsoft.Web.Media.SmoothStreaming
Assembly: Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)
Syntax
'Declaration
<TemplatePartAttribute(Name := "MediaElement", Type := GetType(MediaElement))> _
<TemplatePartAttribute(Name := "RootElement", Type := GetType(Panel))> _
<TemplateVisualStateAttribute(Name := "Normal", GroupName := "PlaybackModes")> _
<TemplateVisualStateAttribute(Name := "ClipPlayback", GroupName := "PlaybackModes")> _
Public Class SmoothStreamingMediaElement _
Inherits Control _
Implements IDisposable
'Usage
Dim instance As SmoothStreamingMediaElement
[TemplatePartAttribute(Name = "MediaElement", Type = typeof(MediaElement))]
[TemplatePartAttribute(Name = "RootElement", Type = typeof(Panel))]
[TemplateVisualStateAttribute(Name = "Normal", GroupName = "PlaybackModes")]
[TemplateVisualStateAttribute(Name = "ClipPlayback", GroupName = "PlaybackModes")]
public class SmoothStreamingMediaElement : Control,
IDisposable
[TemplatePartAttribute(Name = L"MediaElement", Type = typeof(MediaElement))]
[TemplatePartAttribute(Name = L"RootElement", Type = typeof(Panel))]
[TemplateVisualStateAttribute(Name = L"Normal", GroupName = L"PlaybackModes")]
[TemplateVisualStateAttribute(Name = L"ClipPlayback", GroupName = L"PlaybackModes")]
public ref class SmoothStreamingMediaElement : public Control,
IDisposable
[<TemplatePartAttribute(Name = "MediaElement", Type = typeof(MediaElement))>]
[<TemplatePartAttribute(Name = "RootElement", Type = typeof(Panel))>]
[<TemplateVisualStateAttribute(Name = "Normal", GroupName = "PlaybackModes")>]
[<TemplateVisualStateAttribute(Name = "ClipPlayback", GroupName = "PlaybackModes")>]
type SmoothStreamingMediaElement =
class
inherit Control
interface IDisposable
end
public class SmoothStreamingMediaElement extends Control implements IDisposable
The SmoothStreamingMediaElement type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SmoothStreamingMediaElement | Initializes a new instance of the SmoothStreamingMediaElement class. |
Top
Properties
Name | Description | |
---|---|---|
ActualHeight | (Inherited from FrameworkElement.) | |
ActualWidth | (Inherited from FrameworkElement.) | |
AllowDrop | (Inherited from UIElement.) | |
Attributes | Gets or sets the attributes dictionary. | |
AudioStreamCount | Gets or sets the audio stream count. (This property is available only for Windows Media Video (.wmv) content.) | |
AudioStreamIndex | Gets or sets the audio stream index. (This property is available only for Windows Media Video (.wmv) content.) | |
AutoPlay | Gets or sets a value that specifies whether the media element starts automatically. | |
Background | (Inherited from Control.) | |
Balance | Gets or sets the audio balance. | |
BorderBrush | (Inherited from Control.) | |
BorderThickness | (Inherited from Control.) | |
BufferingProgress | Gets or sets the buffering progress. (This property is available only for Windows Phone clients, not for Silverlight.) | |
BufferingTime | Gets or sets the duration of media content that will be buffered before playback can start or continue. | |
CacheMode | (Inherited from UIElement.) | |
CanPause | Gets or sets a value that specifies whether the stream can be paused. | |
CanSeek | Gets or sets whether the position in the stream can be reset. | |
CharacterSpacing | (Inherited from Control.) | |
Clip | (Inherited from UIElement.) | |
ClipMediaElementStyle | Gets or sets the style object for the window. | |
ClipPosition | Gets or sets the position in a clip stream. | |
ConfigPath | Gets or sets the path of the configuration file. | |
CookieContainer | Gets or set the cookie container that will be used with all HTTP requests. | |
CurrentLinearClipContext | Gets the current linear clip context. | |
CurrentSegmentIndex | Gets the index of the currently playing segment. | |
CurrentState | Gets or sets the current state of playback. | |
Cursor | (Inherited from FrameworkElement.) | |
DataContext | (Inherited from FrameworkElement.) | |
DefaultStyleKey | (Inherited from Control.) | |
DesiredSize | (Inherited from UIElement.) | |
Dispatcher | (Inherited from DependencyObject.) | |
DownloadProgress | Gets or sets the download progress. | |
DownloadProgressOffset | Gets or sets the progress offset as a percentage. | |
DroppedFramesPerSecond | Gets or sets the percentage of dropped frames per second. | |
Effect | (Inherited from UIElement.) | |
EnableGPUAcceleration | Gets or sets a value that indicates whether Global Processing Unit (GPU) acceleration is enabled | |
EndPosition | Gets or sets the end position. | |
FlowDirection | (Inherited from FrameworkElement.) | |
FontFamily | (Inherited from Control.) | |
FontSize | (Inherited from Control.) | |
FontStretch | (Inherited from Control.) | |
FontStyle | (Inherited from Control.) | |
FontWeight | (Inherited from Control.) | |
Foreground | (Inherited from Control.) | |
Height | (Inherited from FrameworkElement.) | |
HorizontalAlignment | (Inherited from FrameworkElement.) | |
HorizontalContentAlignment | (Inherited from Control.) | |
IsDecodingOnGPU | Gets a value that indicates whether Global Processing Unit (GPU) decoding is enabled. | |
IsEnabled | (Inherited from Control.) | |
IsHitTestVisible | (Inherited from UIElement.) | |
IsLive | Gets or sets a value that indicates whether the current position is close to the live broadcast position. | |
IsLivePosition | Gets or sets a value that indicates whether the current position is close to the live broadcast position. | |
IsMuted | Gets or sets a value that indicates whether the audio track is muted. | |
IsTabStop | (Inherited from Control.) | |
Language | (Inherited from FrameworkElement.) | |
LicenseAcquirer | Gets or sets the license acquirer. | |
LiveBackOff | Gets or sets the duration of content closest to live that cannot yet be downloaded. | |
LivePlaybackOffset | Gets or sets how far back from the live position, excluding LiveBackOff, to start playback when joining a live presentation. Increasing this value allows the pre-roll buffer to fill faster than real time and creates a buffer against network jitter, but increases the end-to-end latency of the presentation. The default value is 7 seconds. Changes that are made to this value after the SmoothStreamingSource property has been set are disregarded. | |
LivePlaybackStartPosition | Gets or sets the starting position to use during live playback. | |
LivePosition | Gets the position that is nearest to the live stream that a client can seek to. | |
ManifestInfo | Gets the manifest info object. | |
Margin | (Inherited from FrameworkElement.) | |
Markers | Gets the markers collection. | |
Master | Gets or sets the master (parent) object. | |
MaxHeight | (Inherited from FrameworkElement.) | |
MaxWidth | (Inherited from FrameworkElement.) | |
MinHeight | (Inherited from FrameworkElement.) | |
MinWidth | (Inherited from FrameworkElement.) | |
Name | (Inherited from FrameworkElement.) | |
NaturalDuration | Gets the duration of the current stream when it plays to the end. | |
NaturalVideoHeight | Gets the height of the video display at which the resource appears best. | |
NaturalVideoWidth | Gets the width of video display at which the resource appears best. | |
Opacity | (Inherited from UIElement.) | |
OpacityMask | (Inherited from UIElement.) | |
Padding | (Inherited from Control.) | |
Parent | (Inherited from FrameworkElement.) | |
PipMode | Gets or sets a value that indicates whether the media stream is in picture-in-picture (PIP) mode. | |
PlaybackRate | Gets the playback rate. | |
Position | Gets or sets the position in the current stream. | |
Projection | (Inherited from UIElement.) | |
RenderedFramesPerSecond | Gets the rate of rendered frames. | |
RenderSize | (Inherited from UIElement.) | |
RenderTransform | (Inherited from UIElement.) | |
RenderTransformOrigin | (Inherited from UIElement.) | |
Resources | (Inherited from FrameworkElement.) | |
SmoothStreamingCache | Gets or sets the Smooth Streaming cache to use during main content playback. | |
SmoothStreamingPlaybackMode | Gets or sets the Smooth Streaming playback mode to use during main content playback. | |
SmoothStreamingSource | Gets or sets the URI of the Smooth Streaming source. | |
Source | Gets or sets a media stream source that is not a Smooth Streaming source. | |
StartPosition | Gets or sets the start position of the current stream. | |
Stretch | Gets or sets an object that determines how to stretch the media display. | |
Style | (Inherited from FrameworkElement.) | |
SupportedPlaybackRates | Gets or sets the playback rates list. | |
TabIndex | (Inherited from Control.) | |
TabNavigation | (Inherited from Control.) | |
Tag | (Inherited from FrameworkElement.) | |
Template | (Inherited from Control.) | |
TotalBytesDownloaded | Gets the total bytes downloaded. | |
TrailingWindowDuration | Gets or sets the trailing window duration. | |
Triggers | (Inherited from FrameworkElement.) | |
UseLayoutRounding | (Inherited from UIElement.) | |
VerticalAlignment | (Inherited from FrameworkElement.) | |
VerticalContentAlignment | (Inherited from Control.) | |
VideoDownloadTrack | Gets the video download track. | |
VideoHighestPlayableTrack | Gets the track that has the highest available bandwidth. | |
VideoPlaybackTrack | Gets the video playback track. | |
Visibility | (Inherited from UIElement.) | |
Volume | Gets or sets the audio volume. | |
Width | (Inherited from FrameworkElement.) |
Top
Methods
Name | Description | |
---|---|---|
AddHandler | (Inherited from UIElement.) | |
ApplyTemplate | (Inherited from Control.) | |
Arrange | (Inherited from UIElement.) | |
ArrangeOverride | (Inherited from FrameworkElement.) | |
CaptureMouse | (Inherited from UIElement.) | |
CheckAccess | (Inherited from DependencyObject.) | |
ClearValue | (Inherited from DependencyObject.) | |
Dispose | Disposes the SmoothStreamingMediaElement object. | |
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
FindName | (Inherited from FrameworkElement.) | |
FlushBuffers | Flushes audio and video buffers, retaining a specified amount of content if possible. | |
Focus | (Inherited from Control.) | |
GetAnimationBaseValue | (Inherited from DependencyObject.) | |
GetBindingExpression | (Inherited from FrameworkElement.) | |
GetHashCode | (Inherited from Object.) | |
GetTemplateChild | (Inherited from Control.) | |
GetType | (Inherited from Object.) | |
GetValue | (Inherited from DependencyObject.) | |
InvalidateArrange | (Inherited from UIElement.) | |
InvalidateMeasure | (Inherited from UIElement.) | |
Measure | (Inherited from UIElement.) | |
MeasureOverride | (Inherited from FrameworkElement.) | |
MemberwiseClone | (Inherited from Object.) | |
MergeExternalManifest | Replaces some elements of the main manifest with others from an external manifest or adds new elements to the main manifest. | |
OnApplyTemplate | Disconnects and connects event handlers and key properties during a template change. (Overrides FrameworkElement.OnApplyTemplate().) | |
OnCreateAutomationPeer | (Inherited from UIElement.) | |
OnDoubleTap | (Inherited from Control.) | |
OnDragEnter | (Inherited from Control.) | |
OnDragLeave | (Inherited from Control.) | |
OnDragOver | (Inherited from Control.) | |
OnDrop | (Inherited from Control.) | |
OnGotFocus | (Inherited from Control.) | |
OnHold | (Inherited from Control.) | |
OnKeyDown | (Inherited from Control.) | |
OnKeyUp | (Inherited from Control.) | |
OnLostFocus | (Inherited from Control.) | |
OnLostMouseCapture | (Inherited from Control.) | |
OnManipulationCompleted | (Inherited from Control.) | |
OnManipulationDelta | (Inherited from Control.) | |
OnManipulationStarted | (Inherited from Control.) | |
OnMouseEnter | (Inherited from Control.) | |
OnMouseLeave | (Inherited from Control.) | |
OnMouseLeftButtonDown | (Inherited from Control.) | |
OnMouseLeftButtonUp | (Inherited from Control.) | |
OnMouseMove | (Inherited from Control.) | |
OnMouseRightButtonDown | (Inherited from Control.) | |
OnMouseRightButtonUp | (Inherited from Control.) | |
OnMouseWheel | (Inherited from Control.) | |
OnTap | (Inherited from Control.) | |
OnTextInput | (Inherited from Control.) | |
OnTextInputStart | (Inherited from Control.) | |
OnTextInputUpdate | (Inherited from Control.) | |
ParseExternalManifest | Downloads, parses, and returns an object that represents the specified external manifest. | |
Pause | Pauses playing of audio or video media. | |
Play | Starts playing audio or video media. | |
ReadLocalValue | (Inherited from DependencyObject.) | |
ReleaseMouseCapture | (Inherited from UIElement.) | |
RemoveHandler | (Inherited from UIElement.) | |
RequestLog | Sends a request to generate a log that will be raised by the System.Windows.Controls.MediaElement.LogReady event. | |
ScheduleClip(ClipInformation, ClipContext, Object) | Schedules playing of a media clip. | |
ScheduleClip(ClipInformation, Boolean, Object) | Schedules playing of a media clip. | |
ScheduleClip(ClipInformation, Boolean, TimeSpan, Object) | Schedules playing of a media clip. | |
ScheduleClip(ClipInformation, TimeSpan, Boolean, Object) | Schedules playing of a media clip. | |
ScheduleLinearClip | Schedules play of a linear media clip. | |
SetBinding | (Inherited from FrameworkElement.) | |
SetPlaybackRangeAsync | Specifies a start position for playing media content. | |
SetPlaybackRate | Sets the playback rate of media stream. | |
SetSource | Sets the source of the SmoothStreamingMediaElement object. | |
SetValue | (Inherited from DependencyObject.) | |
StartSeekToLive | Starts a seek to a live media stream. | |
Stop | Stops playing by the SmoothStreamingMediaElement object. | |
ToString | (Inherited from Object.) | |
TransformToVisual | (Inherited from UIElement.) | |
UpdateLayout | (Inherited from UIElement.) |
Top
Events
Name | Description | |
---|---|---|
BindingValidationError | (Inherited from FrameworkElement.) | |
BufferingProgressChanged | Occurs when the BufferingProgress property changes. | |
ChunkDownloadFailed | Occurs when the chunk download associated with an audio or video stream fails. | |
ClipClickThrough | Occurs when a user clicks the media display. | |
ClipError | Occurs when an error is raised while audio or video media is playing. | |
ClipProgressUpdate | Occurs when media reaches a marker. | |
ClipStateChanged | Occurs when a media clip state changes. | |
CurrentStateChanged | Occurs when the current state of media element changes. | |
DataContextChanged | (Inherited from FrameworkElement.) | |
DoubleTap | (Inherited from UIElement.) | |
DownloadProgressChanged | Occurs when the DownloadProgress property changes. | |
DownloadTrackChanged | Occurs when the track selected for download differs from the previously selected track. | |
DragEnter | (Inherited from UIElement.) | |
DragLeave | (Inherited from UIElement.) | |
DragOver | (Inherited from UIElement.) | |
DrmSetupDecryptorCompleted | Occurs when the digital rights managment (DRM) decryptor setup has completed. | |
Drop | (Inherited from UIElement.) | |
GotFocus | (Inherited from UIElement.) | |
Hold | (Inherited from UIElement.) | |
IsEnabledChanged | (Inherited from Control.) | |
KeyDown | (Inherited from UIElement.) | |
KeyUp | (Inherited from UIElement.) | |
LayoutUpdated | (Inherited from FrameworkElement.) | |
LinearClipChanged | Occurs when a media stream transitions in and out of a linear clip between two linear ads. | |
LiveEventCompleted | Occurs when a live media stream ends. | |
Loaded | (Inherited from FrameworkElement.) | |
LogReady | Occurs when the log generated by the RequestLog method is ready. | |
LostFocus | (Inherited from UIElement.) | |
LostMouseCapture | (Inherited from UIElement.) | |
ManifestMerge | Occurs when the main manifest has been parsed. | |
ManifestReady | Occurs when the manifest for the Smooth Streaming content is available for track selection. | |
ManipulationCompleted | (Inherited from UIElement.) | |
ManipulationDelta | (Inherited from UIElement.) | |
ManipulationStarted | (Inherited from UIElement.) | |
MarkerReached | Occurs when media playback reaches a timeline marker. | |
MediaCommand | (Inherited from UIElement.) | |
MediaEnded | Occurs when media playback reaches the end. | |
MediaFailed | Occurs when there is an error associated with the media source. | |
MediaOpened | Occurs when the media stream has been validated and opened and the file headers have been read. | |
MouseEnter | (Inherited from UIElement.) | |
MouseLeave | (Inherited from UIElement.) | |
MouseLeftButtonDown | (Inherited from UIElement.) | |
MouseLeftButtonUp | (Inherited from UIElement.) | |
MouseMove | (Inherited from UIElement.) | |
MouseRightButtonDown | (Inherited from UIElement.) | |
MouseRightButtonUp | (Inherited from UIElement.) | |
MouseWheel | (Inherited from UIElement.) | |
PlaybackTrackChanged | Occurs when the currently playing track changes. | |
SeekCompleted | Occurs when a seek operation completes. | |
SetPlaybackRangeCompleted | Occurs when a SetPlaybackRangeAsync operation has completed. | |
SizeChanged | (Inherited from FrameworkElement.) | |
SmoothStreamingErrorOccurred | Occurs when an error is raised during playback of Smooth Streaming content. | |
Tap | (Inherited from UIElement.) | |
TextInput | (Inherited from UIElement.) | |
TextInputStart | (Inherited from UIElement.) | |
TextInputUpdate | (Inherited from UIElement.) | |
Unloaded | (Inherited from FrameworkElement.) | |
VideoHighestPlayableTrackChanged | Occurs when the playback rate changes to the highest available rate. |
Top
Fields
Name | Description | |
---|---|---|
AttributesProperty | Represents a dependency property that specifies the Attributes property dictionary object. | |
AudioStreamCountProperty | Represents a dependency property that specifies the AudioStreamCount property. | |
AudioStreamIndexProperty | Represents a dependency property that specifies the AudioStreamIndex property. | |
AutoPlayProperty | Represents a dependency property that specifies the AutoPlay property. | |
BalanceProperty | Represents a dependency property that specifies the Balance property. | |
BufferingProgressProperty | Represents a dependency property that specifies the BufferingProgress property. | |
BufferingTimeProperty | Represents a dependency property that specifies the BufferingTime property. | |
CanPauseProperty | Represents a dependency property that specifies the CanPause property. | |
CanSeekProperty | Represents a dependency property that specifies the CanSeek property. | |
ClipMediaElementStyleProperty | Represents a dependency property that specifies the ClipMediaElementStyle property. | |
ClipPositionProperty | Represents a dependency property that specifies the ClipPosition property. | |
ConfigPathProperty | Represents a dependency property that specifies the ConfigPath property. | |
CurrentSegmentIndexProperty | Represents a dependency property that represents the CurrentSegmentIndex property. | |
CurrentStateProperty | Represents a dependency property that specifies the CurrentState property. | |
DownloadProgressOffsetProperty | Represents a dependency property that specifies the DownloadProgressOffset property. | |
DownloadProgressProperty | Represents a dependency property that specifies the DownloadProgress property. | |
EnableGPUAccelerationProperty | Represents a dependency property that specifies the EnableGPUAcceleration property. | |
IsDecodingOnGPUProperty | Represents a dependency property that specifies the IsDecodingOnGPU property. | |
IsMutedProperty | Represents a dependency property that specifies the IsMuted property. | |
LiveBackOffProperty | Represents a dependency property that specifies the LiveBackOff property. | |
LivePlaybackOffsetProperty | Represents a dependency property that specifies the LivePlaybackOffset property. | |
LivePlaybackStartPositionProperty | Represents a dependency property that specifies the LivePlaybackStartPosition property. | |
NaturalDurationProperty | Represents a dependency property that specifies the NaturalDuration property. | |
NaturalVideoHeightProperty | Represents a dependency property that specifies the NaturalVideoHeight property. | |
NaturalVideoWidthProperty | Represents a dependency property that specifies the NaturalVideoWidth property. | |
PipModeProperty | Represents a dependency property that specifies the PipMode property. | |
PlaybackRateProperty | Represents a dependency property that represents the PlaybackRate property. | |
PositionProperty | Represents a dependency property that specifies the Position property. | |
SmoothStreamingCacheProperty | Represents a dependency property that represents the SmoothStreamingCache property. | |
SmoothStreamingPlaybackModeProperty | Represents a dependency property that represents the SmoothStreamingPlaybackMode property. | |
SmoothStreamingSourceProperty | Represents a dependency property that specifies the SmoothStreamingSource property. | |
SourceProperty | Represents a dependency property that specifies the Source property. | |
StretchProperty | Represents a dependency property that specifies the Stretch property. | |
VideoDownloadTrackProperty | Represents a dependency property that represents the VideoDownloadTrack property. | |
VideoHighestPlayableTrackProperty | Represents a dependency property that represents the VideoHighestPlayableTrack property. | |
VideoPlaybackTrackProperty | Represents a dependency property that specifies the VideoPlaybackTrack property. | |
VolumeProperty | Represents a dependency property that specifies the Volume property. |
Top
Remarks
The MediaElement object is rendered as a rectangular region that can display video or play audio without video display. The SmoothStreamingMediaElement class supports the features of System.UIElement and MediaElement operations such as mouse and keyboard events and the ability to capture focus.
You can specify the height and width of the media display surface by using the height and width properties in XAML. However, for best performance, avoid explicitly setting the height and width. Instead, leave the values unset; this lets the media resource display at its encoded size, and the Silverlight application will calibrate the size of the display. If you have to change the media-display size, it is best to re-encode the media to the target size by using a media-encoding tool.
Examples
For more information and implementation examples, see Microsoft Smooth Streaming Client 2.0.
Version Information
Silverlight
Supported in: 5
Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.