示例#1
0
        public async Task GetMediaAsync()
        {
            IMediaProvider mediaFactory =
                ClientCore.Factory.MediaFactory.Singleton.CreateMediaProvider();

            Media Media = (Media)await mediaFactory.GetMediaAsync();

            AudioMediaDevicesCapturersList = await Media.GetMediaDevicesAsync(MediaKind.AudioInputDevice);

            AudioMediaDevicesRendersList = await Media.GetMediaDevicesAsync(MediaKind.AudioOutputDevice);

            VideoMediaDevicesList = await Media.GetMediaDevicesAsync(MediaKind.VideoDevice);

            AudioCodecsList = await Media.GetCodecsAsync(MediaKind.AudioCodec);

            VideoCodecsList = await Media.GetCodecsAsync(MediaKind.VideoCodec);
        }
示例#2
0
        async Task <object> MapLinkedMediaAsync(object source)
        {
            Guid id;

            if (Guid.TryParse((string)source, out id))
            {
                try
                {
                    return(await _mediaProvider.GetMediaAsync(id));
                }
                catch
                {
                    _log.LogDebug($"Failed to map linked media {id}");
                    return(null);
                }
            }

            return(null);
        }
示例#3
0
 public async Task <MediaItem> GetMediaItemAsync(Guid id)
 => await _mediaProvider.GetMediaAsync(id);