PlayToSource.Next 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
다음 Play To 소스 요소를 가져오거나 설정합니다.
public:
property PlayToSource ^ Next { PlayToSource ^ get(); void set(PlayToSource ^ value); };
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
PlayToSource Next();
void Next(PlayToSource value);
/// [get: Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
/// [set: Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
PlayToSource Next();
void Next(PlayToSource value);
public PlayToSource Next { [Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] get; [Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))] set; }
public PlayToSource Next { [Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] get; [Windows.Foundation.Metadata.Deprecated("PlayToSource may be altered or unavailable for releases after Windows 10. Instead, use CastingSource.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")] set; }
var playToSource = playToSource.next;
playToSource.next = playToSource;
Public Property Next As PlayToSource
속성 값
다음 재생 원본 요소입니다.
- 특성
예제
// Set up the Play To contract.
// Used to pass an image to Play To that will not be removed/destroyed
// by the slide show logic. For example, if the user opens the Devices
// charm and the sourcerequested event fires, but the image display timeout
// completes before the user selects a target device, then the image that
// was being displayed is removed and destroyed. initialImage is never
// destroyed so Play To will always have a valid source to stream.
Image initialImage = null;
private async void SourceRequested(Windows.Media.PlayTo.PlayToManager sender,
Windows.Media.PlayTo.PlayToSourceRequestedEventArgs e)
{
var deferral = e.SourceRequest.GetDeferral();
await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
() =>
{
initialImage = new Image();
// Use the statechanged event of the image passed to Play To to determine when
// the image is finally connected to the Play To Receiver.
initialImage.PlayToSource.Connection.StateChanged += InitialImageConnectionStateChanged;
// Provide Play To with the first image to stream.
e.SourceRequest.SetSource(initialImage.PlayToSource);
deferral.Complete();
});
}
private async void InitialImageConnectionStateChanged(Windows.Media.PlayTo.PlayToConnection sender,
Windows.Media.PlayTo.PlayToConnectionStateChangedEventArgs e)
{
if (e.CurrentState == Windows.Media.PlayTo.PlayToConnectionState.Connected) {
await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
async () =>
{
// Clear any existing timeout.
if (timer != null) { timer.Stop(); }
// Clear the slide show panel.
SlideShowPanel.Children.Clear();
// Set the slide show objects and values to show that we are streaming.
streaming = true;
DisconnectButton.Visibility = Visibility.Visible;
InstructionsBlock.Visibility = Visibility.Collapsed;
// Queue and display the next image.
var image = await QueueImage(currentImage, true);
initialImage.PlayToSource.Next = image.PlayToSource;
initialImage.PlayToSource.PlayNext();
});
};
}
// Update the once the user has selected a device to stream to.
private async void SourceSelected(Windows.Media.PlayTo.PlayToManager sender,
Windows.Media.PlayTo.PlayToSourceSelectedEventArgs e)
{
await dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
() =>
{
DisconnectButton.Click += DisconnectButtonClick;
MessageBlock.Text = "Streaming to " + e.FriendlyName + "...";
DeviceBlock.Text = e.FriendlyName + ".\nClick here to disconnect.";
var imageBitmap = new Windows.UI.Xaml.Media.Imaging.BitmapImage();
imageBitmap.SetSource(e.Icon);
IconImage.Source = imageBitmap;
});
}
private void DisconnectButtonClick(object sender, RoutedEventArgs e)
{
Windows.Media.PlayTo.PlayToManager.ShowPlayToUI();
}
' Set up the Play To contract.
' Used to pass an image to Play To that will not be removed/destroyed
' by the slide show logic. For example, if the user opens the Devices
' charm and the sourcerequested event fires, but the image display timeout
' completes before the user selects a target device, then the image that
' was being displayed is removed and destroyed. initialImage is never
' destroyed so Play To will always have a valid source to stream.
Private initialImage As Image = Nothing
Private Async Sub SourceRequested(sender As Windows.Media.PlayTo.PlayToManager,
e As Windows.Media.PlayTo.PlayToSourceRequestedEventArgs)
Dim deferral = e.SourceRequest.GetDeferral()
Await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
initialImage = New Image()
' Use the statechanged event of the image passed to Play To to determine when
' the image is finally connected to the Play To Receiver.
AddHandler initialImage.PlayToSource.Connection.StateChanged, AddressOf InitialImageConnectionStateChanged
' Provide Play To with the first image to stream.
e.SourceRequest.SetSource(initialImage.PlayToSource)
deferral.Complete()
End Sub)
End Sub
Private Async Sub InitialImageConnectionStateChanged(sender As Windows.Media.PlayTo.PlayToConnection,
e As Windows.Media.PlayTo.PlayToConnectionStateChangedEventArgs)
If e.CurrentState = Windows.Media.PlayTo.PlayToConnectionState.Connected Then
Await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
Async Sub()
' Clear any existing timeout.
If timer IsNot Nothing Then timer.Stop()
' Clear the slide show panel.
SlideShowPanel.Children.Clear()
' Set the slide show objects and values to show that we are streaming.
streaming = True
DisconnectButton.Visibility = Visibility.Visible
InstructionsBlock.Visibility = Visibility.Collapsed
' Queue and display the next image.
Dim image = Await QueueImage(currentImage, True)
initialImage.PlayToSource.Next = image.PlayToSource
initialImage.PlayToSource.PlayNext()
End Sub)
End If
End Sub
' Update the once the user has selected a device to stream to.
Private Async Sub SourceSelected(sender As Windows.Media.PlayTo.PlayToManager,
e As Windows.Media.PlayTo.PlayToSourceSelectedEventArgs)
Await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
Sub()
AddHandler DisconnectButton.Click, AddressOf DisconnectButtonClick
MessageBlock.Text = "Streaming to " & e.FriendlyName & "..."
DeviceBlock.Text = e.FriendlyName & "." & vbCr & "Click here to disconnect."
Dim imageBitmap = New Windows.UI.Xaml.Media.Imaging.BitmapImage()
imageBitmap.SetSource(e.Icon)
IconImage.Source = imageBitmap
End Sub)
End Sub
Private Sub DisconnectButtonClick()
Windows.Media.PlayTo.PlayToManager.ShowPlayToUI()
End Sub
설명
Next 속성을 사용하는 예제는 미디어 캐스팅을 참조하세요.