Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling Windows Media Player with VBA from Excel

Status
Not open for further replies.

dtutton

Technical User
Mar 28, 2001
58
DE
Ive managed to embed media player in Excel (2010) and control the size and starting and stopping. I want to contol the speed. Has anyone done this and suggest a method

Thanks

 
player.controls.fastForward(),
player.controls.fastReverse() and you may want to keep an eye on
PlayStateChange(NewState)

Value State Description
0 Undefined Windows Media Player is in an undefined state.
1 Stopped Playback of the current media item is stopped.
2 Paused Playback of the current media item is paused. When a media item is paused, resuming playback begins from the same location.
3 Playing The current media item is playing.
4 ScanForward The current media item is fast forwarding.
5 ScanReverse The current media item is fast rewinding.
6 Buffering The current media item is getting additional data from the server.
7 Waiting Connection is established, but the server is not sending data. Waiting for session to begin.
8 MediaEnded Media item has completed playback.
9 Transitioning Preparing new media item.
10 Ready Ready to begin playing.
11 Reconnecting Reconnecting to stream.

The fastForward method does not work for live broadcasts and certain media types. To determine whether you can fast forward in a clip, call isAvailable("FastForward").

This sets the rate to 5 (default is 1) or 5x the speed of original playback.

You may prefer finer grained control and forget about the fast forward method by simply setting
player.settings.rate
to any number you wish. Again, 1 is the default(think 1x speed) with 2 being twice as fast etc.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top