PlayToManager.GetForCurrentView | getForCurrentView method
Gets the Play To manager for the current view.
Syntax
public static 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 private Windows.Media.PlayTo.PlayToManager ptm = Windows.Media.PlayTo.PlayToManager.GetForCurrentView(); protected override void OnNavigatedTo(NavigationEventArgs e) { ptm.SourceRequested += sourceRequestHandler; } private void sourceRequestHandler( Windows.Media.PlayTo.PlayToManager sender, Windows.Media.PlayTo.PlayToSourceRequestedEventArgs e) { try { e.SourceRequest.SetSource(mediaElement.PlayToSource); } catch (Exception ex) { messageBlock.Text += "Exception encountered: " + ex.Message + "\n"; } }
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012
