EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

PlayToManager.GetForCurrentView | getForCurrentView method

Applies to Windows only

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

Minimum supported phone

None supported

Namespace

Windows.Media.PlayTo
Windows::Media::PlayTo [C++]

Metadata

Windows.winmd

See also

PlayToManager
Samples
Play To sample
PlayToReceiver sample
Media Server sample

 

 

Mostrar:
© 2014 Microsoft