WMP WIN32OLE in Ruby/IRB problem

M

Mike

The following code plays the playlist thourgh IRB in FXRI, but playback
doesn't start when using IRB from the command line.

oPlayer = WIN32OLE.new("WMPlayer.ocx.7")
oPlayer.Settings.autoStart = 1
oPlayListCollection = oPlayer.PlayListCollection.GetAll()
oPlayer.currentPlaylist = oPlayListCollection.item(0) #plays in FXRI,
nothing happens in IRB


also

oPlayer.Controls.play # doesn't work in IRB either.

I'm a newbie, so maybe I'm missing something obvious? any thoughts
appreciated.
 
P

Patrick Spence

Mike said:
The following code plays the playlist thourgh IRB in FXRI, but playback
doesn't start when using IRB from the command line.

oPlayer = WIN32OLE.new("WMPlayer.ocx.7")
oPlayer.Settings.autoStart = 1
oPlayListCollection = oPlayer.PlayListCollection.GetAll()
oPlayer.currentPlaylist = oPlayListCollection.item(0) #plays in FXRI,
nothing happens in IRB


also

oPlayer.Controls.play # doesn't work in IRB either.

I'm a newbie, so maybe I'm missing something obvious? any thoughts
appreciated.

I'm seeing the same problem here. I thought it was something funky that
IRB is doing, or *not* doing. Then I cobbled-up a script and ran it...
still doesn't play. The only way I could get anything to play was by
using the .openPlayer() method.

oPlayer.openPlayer(<my .mp3 file>)

I added the following line after the one that assigns the
currentPlayList property...

puts("Playing track \"#{oPlayer.currentMedia.name}\" from the
\"#{oPlayer.currentPlayList.name}\" playlist")

which spits out something like:
Playing track "Mix 04-05" from the "All Music" playlist
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top