问题
I am using MediaElement tool because MediaPlayerElement tool is unavailable in my vs17 community. I tying to build to this app but facing some error.
How can I solve this? I just copied the code from the link given above and replaced mediaplayer with mediaelement.
回答1:
The Source of MediaElement is Uri type, it Cannot implicitly convert type 'Windows.Media.Core.MediaSource' to 'System.Uri'. That's why you would get this error.
To solve it, you could change your code like the following:
mediaElement.SetMediaStreamSource(MediaSource.CreateFromMediaStreamSource(mediaStreamSource).MediaStreamSource);
来源:https://stackoverflow.com/questions/47611023/how-to-set-mediaelement-source-from-mediastreamsource