我在Windows.Media.Miracast中找到了关于MiracastReceiver的文档。(https://docs.microsoft.com/en-us/uwp/api/windows.media.miracast)但是Windows.Media.Miracast中有太多的类和函数,可能要花很多时间才能理解这些类和接口。有没有开放源代码或示例代码?
非常感谢
发布于 2019-10-07 16:26:53
如果要转换媒体,请使用Windows.Media.Casting命名空间在远程设备上呈现媒体。包括向各种Miracast设备发送媒体。这是官方code sample。以下是示例代码。目前,我们还没有提供Windows.Media.Miracast的教程或代码示例。我会发邮件给相关团队讨论这个问题,如果我们有任何更新,我会在下面更新。
picker = new CastingDevicePicker();
//Set the picker to filter to video capable casting devices
picker.Filter.SupportsVideo = true;
//Hook up device selected event
picker.CastingDeviceSelected += Picker_CastingDeviceSelected;
private async void Picker_CastingDeviceSelected(CastingDevicePicker sender, CastingDeviceSelectedEventArgs args)
{
//Casting must occur from the UI thread. This dispatches the casting calls to the UI thread.
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
{
//Create a casting conneciton from our selected casting device
CastingConnection connection = args.SelectedCastingDevice.CreateCastingConnection();
//Hook up the casting events
connection.ErrorOccurred += Connection_ErrorOccurred;
connection.StateChanged += Connection_StateChanged;
//Cast the content loaded in the media element to the selected casting device
await connection.RequestStartCastingAsync(video.GetAsCastingSource());
});
}https://stackoverflow.com/questions/58258386
复制相似问题