Important alert: (current site time 11/28/2014 10:13:26 AM EDT)
 

winzip icon

UPnP AV Control Point

Email
Submitted on: 11/14/2007 2:31:45 PM
By: Dieter Moeyersons (Belgium) 
Level: Beginner
User Rating: By 4 Users
Compatibility: VB.NET
Views: 37679
(About the author)
 
     This program controls UPnP AV devices. You can brows through content of a Media Server and than play certain items on a Media Renderer. The program uses microsoft c:\windows\system32\upnp.dll to send and receive Upnp-messages and services.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
// for :UPnP AV Control Point
//**************************************
Code is free to use:)
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

11/6/2007 9:52:04 PMBenoit Robin

add this to view the URL of a UPnP router(gateway) :-)
Private Sub lstAllUPnPDevices_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstAllUPnPDevices.DoubleClick
Dim s As UPnPDevice
If lstAllUPnPDevices.SelectedItems.Count = 1 Then
s = DirectCast(lstAllUPnPDevices.SelectedItem, UPnPDeviceListItemWrapper).UPnPDevice
MsgBox(s.PresentationURL)
End If
End Sub
excelent project!
(If this comment was disrespectful, please report it.)

 
11/16/2007 6:11:13 AMLight Templer

Something really new in available VB projects, thx for sharing! LiTe
(If this comment was disrespectful, please report it.)

 
3/26/2008 8:24:38 PMmoosemedia

was just wondering why it wont play. Im assuming it has something to do with the fact that It didn't find any renderers?
(If this comment was disrespectful, please report it.)

 
3/27/2008 3:06:51 PMDieter Moeyersons (Belgium)

It's true, you need an upnp-renderer for playing the music. You can use your computer as an upnp renderer for that by installing Intel's UPnP Tools. http://www.intel.com/cd/ids/developer/asmo-na/eng/downloads/upnp/tools/index.htm
(If this comment was disrespectful, please report it.)

 
4/2/2008 9:45:02 PMmoosemedia

I don't know about you, but I have the DOTNET framework 2.0 installed. Whenever I download either it gives me an error saying I don't have .Net 1.xxx.x.x installed.
(If this comment was disrespectful, please report it.)

 
4/2/2008 9:48:10 PMmoosemedia

I don't know about you, but I have the DOTNET framework 2.0 installed. Whenever I download either it gives me an error saying I don't have .Net 1.xxx.x.x installed.

nevermind... looks like the links were swapped or something
(If this comment was disrespectful, please report it.)

 
4/11/2008 12:09:56 PMmoosemedia

have you ever programmed a renderer, or do you have access to source code of one. The intel one from the link provided is impractical. I am trying to build an all in one app for my media PC. Sounds advantageous, I know, but I have an ASUS wl-500W (looked good on the surface... that was a mistake) but it has a UPnP server, but NO RENDERER. Thought I would right a program for an old laptop I have for my TV. Thanks
(If this comment was disrespectful, please report it.)

 
4/14/2008 1:12:40 PMDieter Moeyersons (Belgium)

you can use the windows media player plugin to play the url of the mp3, because the only thing that upnp does is providing a uri of an mp3 file to the renderer. Since media player can play any uri from any media stream it should work just like that. I'm currently updating my program and the next version will contain an upnp server and renderer as well. (although I don't have much time to work on it)
(If this comment was disrespectful, please report it.)

 
5/19/2010 6:39:18 PMNicolai

This is awesome, but any idea why this won't allow me to play on Win7 (64 bit) Media Player? It will happily find the player as a renderer but play buttons then get greyed out when selected???
(If this comment was disrespectful, please report it.)

 
1/26/2012 3:22:39 PMian

I've just compliled this in VS2010 against .NET 2.0 and I'm getting a NullReferenceException unhandled for myMediaRenderer.AVTransport.SetAVTransportURI(CUInt(0), myObject.Resource(0).URI.ToString, myObject.XMLDump)
Any suggestions?
(If this comment was disrespectful, please report it.)

 
9/18/2012 3:33:54 AMoutseeker

Thanks heaps for such a good DLNA starting point!
Strangely though, I can find and browse no problem but can't play anything to the detected renderer (WMP locally)

Win7 x64; any ideas? :)
(If this comment was disrespectful, please report it.)

 
9/18/2012 4:18:38 AMoutseeker

Hey, I assume it's you (Dieter) moderating the comments? :)

I was having a null value problem at Me.URI = New Uri(xmlNode.InnerText) 'the url which we wil send to the media renderer to play it (where the xmlnode was empty) - I added a MsgBox(Me.URI.ToString) to see if it did any of the files in the folder I selected or what, and it just started working... Now I remove the msgbox and it seems perfect :D

Glad I voted you top marks ;)
(If this comment was disrespectful, please report it.)

 
9/18/2012 10:44:21 AMoutseeker

Sorry mate, I just tested again and it plays from and to my PC no problem. When I try to queue something from my XP PC over the LAN I get a blank URI and a crash
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.