NAME
Win32::WindowsMedia - Base Module for Provisiong and control for Windows Media Services
VERSION
Version 0.20
SYNOPSIS
This is a module to control Windows Media services for a Windows 2003/2008 server. This is a complete change to the pre-alpha releases (0.15 and 0.16) as all functions are now in one module. To create a Windows Media control instance do the following
use Win32::WindowsMedia;
use strict;
my $main =new Win32::WindowsMedia;
my $create_server = $main->Server_Create("127.0.0.1");
The $create_server variable should return 1 on success or 0 on failure. You can then call the other functions against the main object, an example would be
my $publishing_point = $main->Publishing_Point_Create( "127.0.0.1","andrew", "push:*", "broadcast" );
If you can create objects for multiple addresses (need to be in the same domain) you call the functions against the specific IPs. Most uses of the module will be against the local instance of Windows Media which should be 127.0.0.1
Server FUNCTIONS
Server_Create
-
This function create an instance to communicate with the Windows Media Server running. You can specify an IP address, however 99% of the time it should be one of the local interface IPs or localhost(127.0.0.1). It does not matter which IP is used as Windows Media services is not bound to a specific IP.
Server_Create( "<IP>" );
Example of Use
my $result = $main->Server_Create("127.0.0.1");
On success $result will return 1, on failure 0. If there is a failure error is set and can be retrieved.
Server_Destroy
-
This function destroys an instance created to communicate with the Windows Media Server running. You must specify the IP address used to create the instance.
Server_Destroy( "<IP>" );
Example of Use
my $result = $main->Server_Destroy("127.0.0.1");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Control FUNCTIONS
Publishing_Point_Create
-
This function creates a new publishing point on the Windows Media server specified. You need to specify the publishing point, the URL to use ( see example ) and also the type ( again see example ). This function is called through eval ( do not worry if you have no idea what this means ). If the URL specified is invalid Windows Media services will attempt to resolve it and return an invalid callback via OLE. This causes any scripts to stop without warning thus eval catches this nicely.
Publishing_Point_Create( "<IP>", "<publishing point name>", "<URL>", "<Type>" ); Publishing point name - Can be any alphanumeric and _ characters URL - can be one of push:* , or http://<ip>/<pub point> for relay Type - Can be one of OnDemand, Broadcast, CacheProxyOnDemand, CacheProxyBroadcast
Example of Use
my $result = $main->Publishing_Point_Create("127.0.0.1","andrew","push:*","broadcast");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Remove
-
This function removes the publishing point name specified. You need to specify the IP and the publishing point name.
Publishing_Point_Remove( "<IP>", "<publishing point name>" ); my $result = $main->Publishing_Point_Remove("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Start
-
This function is only required if the publishing point in question is not using Push and auto start is off.
Publishing_Point_Start( "<IP>", "<publishing point name>" );
Example of Use
my $result = $main->Publishing_Point_Start("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Stop
-
This can be used on all types of publishing points and causes the source to be disconnected. If auto start is configured on the publishing point will not stop for long, max 30 seconds. If auto start on client connection it will be stopped until a client reconnects.
Publishing_Point_Stop( "<IP>", "<publishing point name>" );
Example of Use
my $result = $main->Publishing_Point_Stop("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_List
-
This function returns an array of the currently provisioned publishing point names. You *may* find at least two which do not show up in the Windows Media adminitration panel. These are for proxy and cache use and should be ignored. You can optionally specify a partial match name which will then only return those publishing points that match.
Publishing_Point_List( "<IP>", "<partial match>" );
Example of Use
my @publishing_point = $main->Publishing_Point_List( "127.0.0.1", "*");
The above will return all publishing points defined.
Publishing_Point_Authorization_ACL_Add
Publishing_Point_Authorization_ACL_Remove
Publishing_Point_Authorization_IPAddress_Add
Publishing_Point_Authorization_IPAddress_Remove
Publishing_Point_Authorization_IPAddress_Get
Publishing_Point_General_Set
Publishing_Point_General_Get
Publishing_Point_Players_Get
Server_CoreVariable_Get
Playlist FUNCTIONS
Playlist_Jump_To_Event
-
This function jumps to a specific section of the current playlist. You need to make sure the playlist you are using is constructed correctly for this to work. You have to specify the server IP, publishing point name and position in the playlist (known as event). If any of the entries are incorrect or the playlist is not correct it will FAIL to jump and return no error.
Playlist_Jump_To_Event( "<IP>", "<publishing point name>", "<playlist position>" );
Example of Use
my $result = $main->Playlist_Jump_To_Event("127.0.0.1","andrew","position2");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved. If an incorrect event, publishing point or IP are specified no error is usually returned.
AUTHOR
Andrew S. Kennedy, <shamrock at cpan.org>
BUGS
Please report any bugs or feature requests to bug-win32-windowsmedia at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Win32-WindowsMedia. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Win32-WindowsMedia
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2008 Andrew S. Kennedy, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
8 POD Errors
The following errors were encountered while parsing the POD:
- Around line 45:
'=item' outside of any '=over'
- Around line 73:
You forgot a '=back' before '=head1'
- Around line 75:
'=item' outside of any '=over'
- Around line 165:
You forgot a '=back' before '=head1'
- Around line 167:
'=item' outside of any '=over'
- Around line 817:
You forgot a '=back' before '=head1'
- Around line 833:
'=item' outside of any '=over'
- Around line 837:
You forgot a '=back' before '=head1'