WMP Object model; How to access "player.currentMedia..."
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
WMP Object model; How to access "player.currentMedia..."

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web
Author Message
John Keith
Guest





Posted: Tue Aug 16, 2005 4:30 pm    Post subject: WMP Object model; How to access "player.currentMedia..." Reply with quote

with out having to have the media actually playing.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/mediagetiteminfo.asp
....indicates that it is possible to access the current.media item(s) with
out having to start playback of the item. How is this done?

Here is my code so far... (this is VBA code from excel's VBE so it might be
a bit different than plain scripting.) If the line of code that starts
playback is skipped; it causes a run time error 91 "Object variable or with
block variable not set"

Sub Test2()
Dim Wmp As WindowsMediaPlayer
Set Wmp = CreateObject("WMPlayer.OCX.7")

Set FirstMedia = Wmp.mediaCollection.getAll.Item(0)

'this starts playback..
Wmp.currentMedia = FirstMedia

Dim Atts(), AtVal() As String
At_Count = Wmp.currentMedia.attributeCount
ReDim Atts(At_Count - 1), AtVal(At_Count - 1) As String
For I = 0 To At_Count - 1
Atts(I) = Wmp.currentMedia.getAttributeName(I)
AtVal(I) = Wmp.currentMedia.getItemInfo(Atts(I))
Next I
'this stops playback
Wmp.Controls.stop
End Sub

Ultimately I will be utilizing .setItemInfo to bring all of my ripped wav
files out of the <unknown> bucket.

--
Regards,
John

Back to top
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> Windows Media on Web All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB