The answer really is in the error text... Cannot control media unless LoadedBehavior
or UnloadedBehavior
is set to Manual
. Therefore, your solution is to set either the MediaElement.LoadedBehavior
or MediaElement.UnloadedBehavior
property to a value of MediaState.Manual
.
From the MediaElement.LoadedBehavior
Property page on MSDN:
LoadedBehavior must be set to Manual in order to interactively control media with the Play, Pause, and Stop methods.
It's amazing what you can find out from MSDN.