How do I determine if MediaElement is playing?

前端 未结 8 2265
闹比i
闹比i 2021-01-01 09:44

Seems simple enough, but I cannot figure out any way to determine what the state of a MediaElement is. There are various properties for some states (such as IsBuffering) but

8条回答
  •  忘掉有多难
    2021-01-01 10:20

    For Silverlight use CurrentState to check whether the state is playing or pause

     if (YourMediaElementName.CurrentState == MediaElementState.Playing)
     {
         // TODO: when media is playing.
     }
    

提交回复
热议问题