Hi,
I discovered Cyberlink for Java while exploring about UPnP AV.
Although the standards mentioned at upnp.org are self-explanatory, the CLink for Java library is not.
There are very few comments/remarks on http://www.cybergarage.org/doxygen/clinkjava/.
I would like to contribute to the project by providing well laid out samples once I get started myself.
Any pointers/links to basic upnp av source code for beginners?
It would be great if someone can attach Java example code for very basic scenario like playing a music/movie(located on a server) file on a TV.
Thanks in anticipation,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-05-26
To be more specific, I m trying to make the following code work:
publicclassDlnaTestimplementsDeviceChangeListener,SearchResponseListener{privatevolatileList<Device>mediaServers;privateList<Device>mediaRenderers;privateControlPointpoint;publicDlnaTest(){this.mediaServers=newArrayList<Device>();this.mediaRenderers=newArrayList<Device>();point=newControlPoint(30900,40900);point.start();log("point started");point.addDeviceChangeListener(this);point.search("upnp:rootdevice");}publicvoidplay(){log("playing starts");Devicetv=this.mediaRenderers.get(0);// ----- unable to figure out the order or actions to be called and parameters to be supplied ActionplayAction=tv.getAction("SetAVTransportURI");playAction.setArgumentValue("CurrentURI","????? http://172.16.3.13:30888/__contentStream/5dee2b801c046ee68b8a341eea6b8edd/TVMOBiLi/s0-1481y5z1311799106.mp3");playAction.setArgumentValue("InstanceID","?????");playAction.postControlAction();playAction=tv.getAction("Play");playAction.setArgumentValue("InstanceID","urn:upnp-org:serviceId:AVTransport");playAction.setArgumentValue("Speed","0");playAction.postControlAction();log("played");}@OverridepublicvoiddeviceAdded(Devicedevice){if(device.getDeviceType().contains("urn:schemas-upnp-org:device:MediaServer:1")){log("adding server"+device.getFriendlyName());this.mediaServers.add(device);}}@OverridepublicvoiddeviceRemoved(Devicedevice){if(device.getDeviceType().contains("urn:schemas-upnp-org:device:MediaServer:1")){log("removing server"+device.getFriendlyName());this.mediaServers.remove(device);}}@OverridepublicvoiddeviceSearchResponseReceived(SSDPPacketarg0){......}publicstaticvoidmain(String[]args)throwsInterruptedException,InvalidDescriptionException{DlnaTesttest=newDlnaTest();Devicerenderer=newDevice("C:\\Users\\Paragon\\Desktop\\SamsungMRDesc.xml");test.mediaRenderers.add(renderer);log("tv added ");Thread.sleep(6000);test.play();test.point.stop();}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I discovered Cyberlink for Java while exploring about UPnP AV.
Although the standards mentioned at upnp.org are self-explanatory, the CLink for Java library is not.
There are very few comments/remarks on http://www.cybergarage.org/doxygen/clinkjava/.
I would like to contribute to the project by providing well laid out samples once I get started myself.
Any pointers/links to basic upnp av source code for beginners?
It would be great if someone can attach Java example code for very basic scenario like playing a music/movie(located on a server) file on a TV.
Thanks in anticipation,
To be more specific, I m trying to make the following code work:
Hi,
I checked your sample code now. But the sample is no good because
the added device is incomplete.
Please check the following users guide 's create user devices normally.
http://www.cybergarage.org/twiki/bin/view/Main/CyberLinkForJava#Repositories
Please check the following repository about samples for UPnP/AV device too.
http://cgupnpjava.svn.sourceforge.net/viewvc/cgupnpjava/trunk/std/src/main/java/org/cybergarage/mediagate/
Best Regards,
Satoshi Konno