Badly designed APIs... 7/24/2013 4:45:00 PM

WMPlayerPlayStateChange fires as the state changes in the Windows Media Player control.

What's your most likely action in response to getting wmppsMediaEnded? Play the next song, right?

Except that if you do this (by setting the .URL property) from the WMPlayerPlayStateChange callback, the song will begin to play... for about a microsecond, before another event from the prior play comes in and wipes everything else out.

You have to use wmppsMediaEnded to instead queue a callback timer that plays the next song a little bit later, after the original songs events have finished firing.

Dumb dumb dumb dumb.

+ Comment
Dave Try the html5 video element ??
EricLaw HTML5's video element won't play WMA files.


< Eric's Blog Home


©1998-2024 Eric Lawrence