PlayToManager クラス

定義

Play To 機能へのアクセスを提供します。

public ref class PlayToManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class PlayToManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
class PlayToManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class PlayToManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("PlayToManager may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class PlayToManager
Public NotInheritable Class PlayToManager
継承
Object Platform::Object IInspectable PlayToManager
属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

// 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";
    }
}
' 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

注釈

アプリケーションにオーディオ、ビデオ、または画像の要素が含まれている場合、ユーザーはそれらの要素のメディア ソースを Play To ターゲット デバイスにストリーミングできます。 PlayToManager クラスを使用して、ユーザーの Play To エクスペリエンスをカスタマイズできます。 DefaultSourceSelection プロパティを使用して、既定の動作を無効にすることができます。SourceRequested イベントを使用して、ストリーミングするメディアを選択できます。 また、ShowPlayToUI メソッドを使用して、[デバイス] チャームの代わりに Play To UI を表示できます。

Play To では、ビデオは現在の位置から開始されます。 最初からビデオを開始する場合は、Play To 接続が確立されたらすぐにビデオの先頭に移動します。

PlayTo アプリは、Play To レシーバーでビデオまたは音楽が再生されている限り、または画像が Play To レシーバーに継続的に送信されている限り中断されません。 アプリは、現在の画像が表示された後に新しい画像を送信するのに約 10 秒、現在の画像が終了した後に次のオーディオまたはビデオを送信するのに約 10 秒です。

アプリケーションで Play To を使用する方法の例については、「 PlayReady DRM」を参照してください。

プロパティ

DefaultSourceSelection

再生先の既定のソース選択を有効または無効にします。

メソッド

GetForCurrentView()

現在のビューの Play To マネージャーを取得します。

ShowPlayToUI()

[再生] UI を表示します。

イベント

SourceRequested

ユーザーが Play To ターゲット デバイスへのストリーミングをメディアに要求したときに発生します。

SourceSelected

[再生先] ソース要素が選択されている場合に発生します。

適用対象

こちらもご覧ください