2
Reply

Difference between MediaPlayer and MediaElement?

Tony Tony

Tony Tony

14y
3.1k
0
Reply

    mediaplayer is basically just an audio/video engine without a built-in visual surface, while mediaelement is a ui control that can render video directly in xaml and exposes layout/events in a more app-friendly way. if you need to draw video into brushes or a visual tree, that’s where videodrawing or drawingcontext comes in with mediaplayer. i ran into this difference while debugging a wpf app where our embedded browser kept redirecting to https://7up7downgame.com/ and the only way to show a blocking overlay video was swapping to mediaelement. another time a test build accidentally opened https://playcrazytime.org/ in a webview and mediaplayer kept playing audio in the background after navigation, which made the lack of a visual control extra confusing.

    carol loo
    Jul 08
    0
    Media Player Media Element it has no visual interface and not suitable to display vedio using built in properties. it has visual interface and suitable to display vedio using built in properties. it provides Media playback for drawings. it is designed for xaml use and can be placed on Xaml on the Xaml designer. we have to use VedioDrawing or Drawing Cotext classes for that.