Export (0) Print
Expand All
0 out of 4 rated this helpful - Rate this topic

MediaElement.SetSource Method (Stream)

Silverlight

Sets the Source property using the supplied stream.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
'Declaration
Public Sub SetSource ( _
	stream As Stream _
)

Parameters

stream
Type: System.IO.Stream
A stream that contains a natively supported media source.
ExceptionCondition
ArgumentNullException

The stream is null.

Use this method rather than setting the Source to a URI for cases where you already have the media available as a stream. For instance, you might have preloaded media by calls to WebClient APIs and have them available as streams already. For details on this technique, see Downloading Content on Demand.

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 Passing a generic stream to SetSource(System.IO.Stream) is not supported in Silverlight for Windows Phone. However, the IsolatedStorageFileStream class, which derives from Stream, is suppoted on Silverlight for Windows Phone.

For additional information on using this method, see Media in Silverlight for Windows Phone.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.