I am working on some library written for UWP apps. My library has set up:
- Target version: 16299
- Min version: 14393
I have MediaPlayerElement
there and would like to check video URL. There was introduced Uri property in 15063.
Gets the URI associated with the MediaSource.
Device family: Windows 10 Creators Update (introduced v10.0.15063.0) API contract: Windows.Foundation.UniversalApiContract (introduced v4)
I thought that I could use something like this:
if (ApiInformation.IsPropertyPresent(typeof(MediaSource).FullName, "Uri"))
{
return (element.MediaPlayer.Source as MediaPlaybackItem)?.Source?.Uri.AbsoluteUri;
}
It actually works but I found out that there is a problem when I include my library to an application which has:
- target and min version 14393.
Exception thrown: 'System.MissingMethodException' in ..............
Method not found: 'System.Uri Windows.Media.Core.MediaSource.get_Uri()'.
try/catch
does not help in this case.
Is there anything else what I can do?