Provides access to Play To capabilities.
Syntax
var playToManager = Windows.Media.PlayTo.PlayToManager;
Attributes
- MarshalingBehaviorAttribute(Agile)
- MuseAttribute()
- StaticAttribute(Windows.Media.PlayTo.IPlayToManagerStatics, NTDDI_WIN8)
- VersionAttribute(NTDDI_WIN8)
Members
The PlayToManager class has these types of members:
Events
The PlayToManager class has these events.
| Event | Description |
|---|---|
| SourceRequested | Occurs when a user requests media to stream to a Play To target device. |
| SourceSelected | Occurs when a Play To source element has been selected. |
Methods
The PlayToManager class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| GetForCurrentView | Gets the Play To manager for the current view. |
| ShowPlayToUI | Displays the Play To UI. |
Properties
The PlayToManager class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write | Enables or disables the default source selection for Play To. |
Remarks
If your application includes audio, video, or image elements, users can stream the media source for those elements to a Play To target device. You can use the PlayToManager class to customize the Play To experience for users. You can disable the default behavior by using the DefaultSourceSelection property.You can select which media is streamed by using the SourceRequested event.And you can show a custom Play To UI in place of the Devices charm by using the ShowPlayToUI method.
In Play To, video starts from the current position. If you want to start the video from the beginning, simply seek to the beginning of the video as soon as the Play To connection is established.
PlayTo apps will not be suspended as long as video or music is playing on the Play To receiver or images are continuously sent to the Play To receiver. Apps have approximately 10 seconds to send a new image after the current one is displayed and approximately 10 seconds to send the next audio or video after the current one has ended.
For an example of how to use Play To in an application, see Quickstart: Using Play To in applications (JavaScript) or Quickstart: Using Play To in applications (C#/VB).
Examples
// Play To Contract var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView(); ptm.addEventListener("sourcerequested", sourceRequestHandler, false); function sourceRequestHandler(e) { try { e.sourceRequest.setSource(mediaElement.msPlayToSource); } catch (ex) { id("messageDiv").innerHTML += "Exception encountered: " + ex.message + "<br/>"; } }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012