PlayToManager.GetForCurrentView | getForCurrentView method
Gets the Play To manager for the current view.
Syntax
Public Shared Function GetForCurrentView() As PlayToManager
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 ptm As Windows.Media.PlayTo.PlayToManager = Windows.Media.PlayTo.PlayToManager.GetForCurrentView() Protected Overrides Sub OnNavigatedTo(e As Navigation.NavigationEventArgs) AddHandler ptm.SourceRequested, AddressOf sourceRequestHandler End Sub Private Sub sourceRequestHandler( sender As Windows.Media.PlayTo.PlayToManager, e As Windows.Media.PlayTo.PlayToSourceRequestedEventArgs) Try e.SourceRequest.SetSource(mediaElement.PlayToSource) Catch ex As Exception messageBlock.Text &= "Exception encountered: " & ex.Message & vbCrLf End Try End Sub
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 12/4/2012
