Windows Media Player
Windows Media Player
Windows Media Player
Windows Media Player
Windows Media Player
Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player
Windows Media Player Windows Media Player
Windows Media Player
Go Back  Xtreme Visual Basic Talk > > > Windows Media Player


Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2007, 03:27 AM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default Windows Media Player


Hi All,

I found this link: http://blogs.msdn.com/coding4fun/arc...31/913360.aspx this is a great article that shows hows to use windows media player in a browser.

I put into a site that I am playing around with and ran locally on my machine it looks pretty good. It list all the artists, songs and artwork etc. The problem is when I put it on my server. I have a machine in my loft which I am now using as a server which has windows server 2003 on it.

I published this site onto this server. The site runs ok with one main difference to how it ran on my local machine. That is the page that shows the list of music is empty. I have manged to track down the part of the code where the problem is:
Code:
Dim wmp As WindowsMediaPlayer = New WindowsMediaPlayer Dim playlist As IWMPPlaylist = wmp.mediaCollection.getAll() Dim artistDictionary As Dictionary(Of String, Artist) = New Dictionary(Of String, Artist) For i As Integer = 0 To playlist.count - 1 'Do all the processing in here... Next
When this code is ran locally the variable playlist has a count greater than zero, however when ran remotely on the server this variable has a count of zero, even though there a thousands of songs on this server which are in the windows media player's library.

No exceptions are being thrown, just this variable is not getting populated with anything.

Any ideas please share, Dave.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #2  
Old 09-11-2007, 03:40 AM
mcdonnc2004's Avatar
mcdonnc2004 mcdonnc2004 is offline
Junior Contributor
 
Join Date: Dec 2003
Location: Liverpool, UK
Posts: 276
Default

It has got to be permissions on the server. It could be that the ASP.NET worker process is not connecting with Media Player correctly but my gut feeling is that the user account under which ASP.NET runs (which as you probably know is quite restricted) does not have access to the folder where your music/playlists are stored.

Give the NETWORK SERVICE user account or the IIS_WPG which is a part of the NETWORK SERVICE account permissions on the music and playlists folder and see if that helps.
Reply With Quote
  #3  
Old 09-11-2007, 12:27 PM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default

Hi,

Can somebody explain how I:
Quote:
Give the NETWORK SERVICE user account or the IIS_WPG which is a part of the NETWORK SERVICE account permissions on the music and playlists folder and see if that helps.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #4  
Old 09-11-2007, 12:45 PM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default

Two thing I nearly forgot to mention:

The entire drive where my music is has been shared i.e. it is public. Also if I set the defaultAppPool to pre defined type to Local System (not advisiable) the web site brings back one artist as unknown which does not play.

Any ideas please share.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #5  
Old 09-12-2007, 04:45 AM
nickel84sg nickel84sg is offline
Newcomer
 
Join Date: Aug 2007
Location: Singapore
Posts: 24
Default

i have no experience in dealing with WindowsMediaPlayer before. But from the look of your coding i believe you are using a DCOM of window media player.

If this is so, i believe by default your window media player DCOM is adopt the default security setting for Launching & Activation Permission which by default will not grant access to your ASPNET account (for win xp) or NETWORK SERVICE(for win 2003/2k) account.

all those will depend on 2 thing:
1) the Identity of the application pool (by default is one of the 2 i stated above)
2) the identity setting of ur media player DCOM


some information on access in your DCOM setting
Start->Run-> type "Dcomcnfg"->Component Services->Computers->My computer->Media Player->Security Tabs/ Identity Tabs

hope that help
Reply With Quote
  #6  
Old 09-12-2007, 07:56 AM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default

Both of these seem to be set to ASPNET. Could you give me a little more detail.

The other thing I was wondering was could it be copyright on the files stopping me from doing this?

Please help, Dave.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #7  
Old 09-12-2007, 08:28 PM
nickel84sg nickel84sg is offline
Newcomer
 
Join Date: Aug 2007
Location: Singapore
Posts: 24
Default

Maybe you want to take a look at the event log on your server when the website is run?

Make sure that ASPNET (i assume that you are running on win xp) been granted remote local activation for Launching & Activation Permission and maybe try Access permission too. Took me quite sometime to play around with this permission setting for DCOM when i was using excel DCOM.
Reply With Quote
  #8  
Old 09-13-2007, 05:06 AM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default

I have looked at the event veiwer logs, couldn't see anything that was wrong.

The machine running this site is on server 2003.

I think I have granted remote local activation for Launching & Activation Permission and Access permission to ASPNET.

Any ideas?
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #9  
Old 09-13-2007, 12:38 PM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default This is so frustrating

Hi,

I am at the stage where I am trying anything and everything to get this thing working.

I think I may have been wrong when I said that I had logged into my server as the user ASPNET to see if this user has these files in their library. In fact when I try to login is that user I get the message "The local policy of this system does not permit you to logon interactively". I have tried various things to fix this but none seem to work.

Whilst doing numerous things I have noticed that I do get some information in the application event viewer: Plug-in 'WMS Anonymous User Authentication' on publishing point 'PublishingPoint1' failed with the following information: Error code = 0x8007052e, Error text = 'Logon failure: unknown user name or bad password. ' This message has only appeared a few times.

I am really struggling here, if there is anything you can think of please share.

Cheers, Dave.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #10  
Old 09-15-2007, 06:22 AM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Question It's me again!

Ok I did some more investigating yesterday to try and find out why this is not working.

As I am not too sure about debugging ASP sites remotely I used some extra code in the sub that I knew was the area where I needed to examine. I simply sent a few emails to myself via the code to get a clearer understanding of what was happening:

Code:
Private Shared Sub Refresh() Dim smtpServer As New System.Net.Mail.SmtpClient Dim EmailServer As String = "SMTP.them.co.uk" Dim ErrorEmailFrom As String = "me@me.co.uk" Dim ErrorEmailTo As String = "me@me.co.uk" Dim msgError As System.Net.Mail.MailMessage Dim wmp As WindowsMediaPlayer = New WindowsMediaPlayer Dim playlist As IWMPPlaylist = wmp.mediaCollection.getAll() Dim artistDictionary As Dictionary(Of String, Artist) = New Dictionary(Of String, Artist) If playlist.count > 0 Then msgError = New System.Net.Mail.MailMessage(ErrorEmailFrom, ErrorEmailTo) msgError.Subject = "Got records, user: " & My.User.Name smtpServer.Host = EmailServer smtpServer.Send(msgError) Else msgError = New System.Net.Mail.MailMessage(ErrorEmailFrom, ErrorEmailTo) msgError.Subject = "No records, user: " & My.User.Name smtpServer.Host = EmailServer smtpServer.Send(msgError) End If For i As Integer = 0 To playlist.count - 1 Dim media As IWMPMedia = playlist.Item(i) Dim albumArtistName As String = media.getItemInfo("AlbumArtist") Dim albumName As String = media.getItemInfo("Album") Dim trackName As String = media.getItemInfo("Title") Dim trackLocation As String = media.getItemInfo("SourceUrl") Dim trackNumberString As String = media.getItemInfo("OriginalIndex") Dim theArtist As Artist = Nothing Dim artistSortName As String = Artist.GetSortName(albumArtistName) If Not artistDictionary.TryGetValue(artistSortName, theArtist) Then theArtist = New Artist(albumArtistName) artistDictionary.Add(artistSortName, theArtist) End If Dim theAlbum As Album = Nothing If Not theArtist.Albums.TryGetValue(albumName, theAlbum) Then theAlbum = New Album(albumName, theArtist) theArtist.Albums.Add(albumName, theAlbum) End If Dim theTrack As Track = Nothing If Not theAlbum.Tracks.TryGetValue(trackName, theTrack) Then Dim trackNumber As Integer If Integer.TryParse(trackNumberString, trackNumber) Then theTrack = New Track(trackNumber, trackName, trackLocation) Else theTrack = New Track(trackName, trackLocation) End If theTrack.Album = theAlbum theAlbum.Tracks.Add(trackName, theTrack) End If msgError.Body = msgError.Body + "playlist count:" & playlist.count.ToString & "albumArtistName: " & albumArtistName & " Album: " & albumName & " trackName: " & trackName & System.Environment.NewLine & "trackLocation: " & trackLocation & System.Environment.NewLine Next ArtistList.AddRange(artistDictionary.Values) ArtistList.Sort() End Sub

Here is an example of the body of an email the code sent me yesterday:

Quote:
playlist count:15albumArtistName: Album: trackName: Favorites -- 4 and 5 star rated
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- 4 and 5 star rated.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- Have not heard recently
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- Have not heard recently.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- Listen to at night
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- Listen to late at night.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- Listen to on Weekdays
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- Listen to on Weekdays.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- Listen to on Weekends
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- Listen to on Weekends.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- One Audio CD worth
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- One Audio CD worth.wpl

playlist count:15albumArtistName: Album: trackName: Favorites -- One Data CD-R worth
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Favorites -- One Data CD-R worth.wpl

playlist count:15albumArtistName: Album: trackName: Fresh tracks -- yet to be played
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Fresh tracks -- yet to be played.wpl

playlist count:15albumArtistName: Album: trackName: Fresh tracks -- yet to be rated
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Fresh tracks -- yet to be rated.wpl

playlist count:15albumArtistName: Album: trackName: Fresh tracks
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Fresh tracks.wpl

playlist count:15albumArtistName: Album: trackName: High bitrate media in my library
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\High bitrate media in my library.wpl

playlist count:15albumArtistName: Album: trackName: Low bitrate media in my library
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Low bitrate media in my library.wpl

playlist count:15albumArtistName: Album: trackName: Music tracks I dislike
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Music tracks I dislike.wpl

playlist count:15albumArtistName: Album: trackName: Music tracks I have not rated
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Music tracks I have not rated.wpl

playlist count:15albumArtistName: Album: trackName: Music tracks with content protection
trackLocation: C:\Documents and Settings\All Users\Documents\My Music\Sample Playlists\00139619\Music tracks with content protection.wpl
What you can see is that ASPNET has no songs at all just 15 playlists. So when the site (http://www.showcaseit.co.uk/, click webmasters login as Admin/Password click hyperlink etc) tries to load the list of songs it just shows one artist as unknown if you click to play this track the code cannot find this one song, as it is not a song but a playlist.

Thanks to some help I manged to log into the server as ASPNET. I opened Windows Media Player and populated its library with all of the songs. This has made absolutely no difference what so ever. I just got shown the same 15 playlist and nothing else.

Thanks for your help so far but please keep it coming if you can.

Cheers, Dave.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
  #11  
Old 09-16-2007, 08:09 PM
nickel84sg nickel84sg is offline
Newcomer
 
Join Date: Aug 2007
Location: Singapore
Posts: 24
Default

just curious how you log into server as aspnet? care to share on this part?

Is the path stored in your play list granted access for ASPNET?
and also read on http://msdn2.microsoft.com/en-us/library/ms755617.aspx.. It might give you some clue base on your event log
Reply With Quote
  #12  
Old 09-17-2007, 06:46 AM
Davearia's Avatar
Davearia Davearia is offline
Junior Contributor
 
Join Date: Jul 2004
Location: In A Perfect Cadence
Posts: 358
Default

Hi,

1. Log into server as aspnet? I made sure that this user had permissions to log in locally and then just entered username password.

2. Is the path stored in your play list granted access for ASPNET? Please forgive me for asking such a simple question but how do I check this?

3. I have read the link. I'll try using these properties and see what else I can find out.

Many thanks, Dave.
__________________
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Windows Media Player
Windows Media Player
Windows Media Player Windows Media Player
Windows Media Player
Windows Media Player
Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player Windows Media Player
Windows Media Player
Windows Media Player
 
Windows Media Player
Windows Media Player
 
-->