Scroll to navigation

Net::UPnP::AV::MediaRenderer(3pm) User Contributed Perl Documentation Net::UPnP::AV::MediaRenderer(3pm)

NAME

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

SYNOPSIS

    use Net::UPnP::ControlPoint;
    use Net::UPnP::AV::MediaRenderer;
 
    my $obj = Net::UPnP::ControlPoint->new();
 
    @dev_list = ();
    while (@dev_list <= 0 || $retry_cnt > 5) {
        @dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
        $retry_cnt++;
    } 
 
    $devNum= 0;
    foreach $dev (@dev_list) {
        my $device_type = $dev->getdevicetype();
        if  ($device_type ne 'urn:schemas-upnp-org:device:MediaRenderer:1') {
            next;
        }
        my $friendlyname = $dev->getfriendlyname(); 
        print "[$devNum] : " . $friendlyname . "\n";
        my $renderer = Net::UPnP::AV::MediaRenderer->new();
        $renderer->setdevice($dev);
        $renderer->stop();
        $renderer->setAVTransportURI(CurrentURI => 'http://xxx.xxx.xxx.xxx/xxxx.mpg');
        $renderer->play(); 
        $devNum++;
    }

DESCRIPTION

The package is a extension UPnP/AV media server.

METHODS

    $renderer = Net::UPnP::AV::MediaRenderer();
    

Creates a new object. Read `perldoc perlboot` if you don't understand that.

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

    $renderer->setdevice($dev);
    

Set a device to the object.

    @action_response = $renderer->setAVTransportURI(
                                        InstanceID => $instanceID, # 0  
                                        CurrentURI => $url, # ''
                                        CurrentURIMetaData => $metaData, # "'
                                        );
    

Set a current content to play, Net::UPnP::ActionResponse.

        @action_response = $renderer->setNextAVTransportURI(
                                                                                InstanceID => $instanceID, # 0  
                                        NextURI => $url, # ''
                                        NextURIMetaData => $metaData, # "'
                                                                                );
    

Set a next content to play, Net::UPnP::ActionResponse.

    @action_response = $renderer->play(
                                                                                InstanceID => $instanceID, # 0  
                                                                                Speed => $url, # 1
                                                                                );
    

Play the specified content.

    @action_response = $renderer->stop(
                                                                                InstanceID => $instanceID, # 0  
                                                                                );
    

Stop the playing content.

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.

2022-12-06 perl v5.36.0