Adding Effects

MediaElement enables you to add both audio and video effects with its AddVideoEffect and AddAudioEffect methods. (You can later remove them by calling RemoveAllEffects.) You pass a string ID, a Boolean that states whether the effect is optional, and extra configuration that can be null if it doesn’t apply.

The Windows Runtime currently includes just one built-in effect: video stabilization. Its ID is "Windows.Media.VideoStabilizationEffect" but you can just use the static VideoEffects.VideoStabilization string property instead. You therefore add it to a MediaElement (named mediaElement) as follows:

// Apply the video stabilization effectmediaElement.AddVideoEffect(  VideoEffects.VideoStabilization, ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.