GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::UPNP::AV::MEDIASERVER (3)

.ds Aq ’

NAME

Net::UPnP::AV::MediaServer - Perl extension for UPnP.

CONTENTS

SYNOPSIS



    use Net::UPnP::ControlPoint;
    use Net::UPnP::AV::MediaServer;

    my $obj = Net::UPnP::ControlPoint->new();

    @dev_list = $obj->search(st =>upnp:rootdevice, mx => 3);

    $devNum= 0;
    foreach $dev (@dev_list) {
        $device_type = $dev->getdevicetype();
        if  ($device_type ne urn:schemas-upnp-org:device:MediaServer:1) {
            next;
        }
        print "[$devNum] : " . $dev->getfriendlyname() . "\n";
        unless ($dev->getservicebyname(urn:schemas-upnp-org:service:ContentDirectory:1)) {
            next;
        }
        $mediaServer = Net::UPnP::AV::MediaServer->new();
        $mediaServer->setdevice($dev);
        @content_list = $mediaServer->getcontentlist(ObjectID => 0);
        foreach $content (@content_list) {
            print_content($mediaServer, $content, 1);
        }
        $devNum++;
    }

    sub print_content {
        my ($mediaServer, $content, $indent) = @_;
        my $id = $content->getid();
        my $title = $content->gettitle();
        for ($n=0; $n<$indent; $n++) {
            print "\t";
        }
        print "$id = $title";
        if ($content->isitem()) {
            print " (" . $content->geturl();
            if (length($content->getdate())) {
                print " - " . $content->getdate();
            }
            print " - " . $content->getcontenttype() . ")";
        }
        print "\n";
        unless ($content->iscontainer()) {
            return;
        }
        @child_content_list = $mediaServer->getcontentlist(ObjectID => $id );
        if (@child_content_list <= 0) {
            return;
        }
        $indent++;
        foreach my $child_content (@child_content_list) {
            print_content($mediaServer, $child_content, $indent);
        }
    }



DESCRIPTION

The package is a extention UPnP/AV media server.

METHODS

<B>newB> - create new Net::UPnP::AV::MediaServer.


    $mservier = Net::UPnP::AV::MediaServer();



Creates a new object. Read ‘perldoc perlbootif you don’t understand that.

The new object is not associated with any UPnP devices. Please use setdevice() to set the device.

<B>setdeviceB> - set a UPnP devices


    $mservier->setdevice($dev);



Set a device to the object.

<B>browseB> - browse the content directory.


    @action_response = $mservier->browse(
                                        ObjectID => $objid, # 0
                                        BrowseFlag => $browseFlag, # BrowseDirectChildren
                                        Filter => $filter, # "*
                                        StartingIndex => $startIndex, # 0
                                        RequestedCount => $reqCount, # 0
                                        SortCriteria => $sortCrit # 
                                        );



Browse the content directory and return the action response, Net::UPnP::ActionResponse.

<B>getcontentlistB> - get the content list.


    @content_list = $mservier->getcontentlist(
                                        ObjectID => $objid, # 0
                                        Filter => $filter, # "*
                                        StartingIndex => $startIndex, # 0
                                        RequestedCount => $reqCount, # 0
                                        SortCriteria => $sortCrit # 
                                        );



Browse the content directory and return the content list. Please see Net::UPnP::AV::Content, Net::UPnP::AV::Item and Net::UPnP::AV::Container.

SEE ALSO

Net::UPnP::AV::Content

Net::UPnP::AV::Item

Net::UPnP::AV::Container

AUTHOR

Satoshi Konno skonno@cybergarage.org

CyberGarage http://www.cybergarage.org

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Satoshi Konno

It may be used, redistributed, and/or modified under the terms of BSD License.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::UPNP::AV::MEDIASERVER (3) 2014-06-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.