1Net::UPnP::AV::ContaineUrs(e3r)Contributed Perl DocumentNaetti:o:nUPnP::AV::Container(3)
2
3
4

NAME

6       Net::UPnP::AV::Container - Perl extension for UPnP.
7

SYNOPSIS

9           use Net::UPnP::ControlPoint;
10           use Net::UPnP::AV::MediaServer;
11
12           my $obj = Net::UPnP::ControlPoint->new();
13
14           @dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
15
16           $devNum= 0;
17           foreach $dev (@dev_list) {
18               $device_type = $dev->getdevicetype();
19               if  ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
20                   next;
21               }
22               print "[$devNum] : " . $dev->getfriendlyname() . "\n";
23               unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
24                   next;
25               }
26               $mediaServer = Net::UPnP::AV::MediaServer->new();
27               $mediaServer->setdevice($dev);
28               @content_list = $mediaServer->getcontentlist(ObjectID => 0);
29               foreach $content (@content_list) {
30                   print_content($mediaServer, $content, 1);
31               }
32               $devNum++;
33           }
34
35           sub print_content {
36               my ($mediaServer, $content, $indent) = @_;
37               my $id = $content->getid();
38               my $title = $content->gettitle();
39               for ($n=0; $n<$indent; $n++) {
40                   print "\t";
41               }
42               print "$id = $title";
43               if ($content->isitem()) {
44                   print " (" . $content->geturl();
45                   if (length($content->getdate())) {
46                       print " - " . $content->getdate();
47                   }
48                   print " - " . $content->getcontenttype() . ")";
49               }
50               print "\n";
51               unless ($content->iscontainer()) {
52                   return;
53               }
54               @child_content_list = $mediaServer->getcontentlist(ObjectID => $id );
55               if (@child_content_list <= 0) {
56                   return;
57               }
58               $indent++;
59               foreach my $child_content (@child_content_list) {
60                   print_content($mediaServer, $child_content, $indent);
61               }
62           }
63

DESCRIPTION

65       The package is a extention UPnP/AV media server, and a sub class of
66       Net::UPnP::AV::Content.
67

METHODS

69       iscontainer - Check if the content is a container.
70               $isContainer = $container->iscontainer();
71
72           Check if the content is a container.
73
74       getid - Get the content ID.
75               $id = $item->getid();
76
77           Get the content ID.
78
79       gettitle - Get the content title.
80               $title = $item->gettitle();
81
82           Get the content title.
83
84       getdate - Get the content date.
85               $date = $item->getdate();
86
87           Get the content date.
88

SEE ALSO

90       Net::UPnP::AV::Content
91
92       Net::UPnP::AV::Item
93

AUTHOR

95       Satoshi Konno skonno@cybergarage.org
96
97       CyberGarage http://www.cybergarage.org
98
100       Copyright (C) 2005 by Satoshi Konno
101
102       It may be used, redistributed, and/or modified under the terms of BSD
103       License.
104
105
106
107perl v5.30.1                      2020-01-30       Net::UPnP::AV::Container(3)
Impressum