Gets the Play To manager for the current view.
Syntax
var playToManager = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
Parameters
This method has no parameters.
Return value
Type: PlayToManager
The Play To manager for the current view.
Remarks
You can use the PlayToManager instance for the current view to establish the Play To contract for the app and customize which media Play To streams to a target device. You supply the media to be streamed during the SourceRequested event by using the SetSource method.
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 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012