Downloading a recording from the live meeting service requires two steps. This first is an API call that fetches a url for a specific recording. For example the following XML snippet ...
<PlaceWareConfCenter authUser="caller id" authPassword="caller password">
<GetURLRequest>
<StringQuery fieldName="name" operator="=" value="meetingName"/>
<OptionList>
<StringOption name="recViewerCompany" value="Company"/>
<StringOption name="recViewerName" value="jondoe"/>
<StringOption name="recViewerEmail" value="jondoe@company.com"/>
<EnumerationOption name="resourceType" value="WindowsMediaMovieRecordingDownload">
<String>ESS</String>
<String>PWP</String>
<String>WindowsMediaMovieRecording</String>
<String>WindowsMediaMovieRecordingDownload</String>
<String>BasicRecording</String>
</EnumerationOption>
</OptionList>
</GetURLRequest>
</PlaceWareConfCenter>
will return a reply with a url to a media file of the recording.
<GetURLReply
url = “string”>
</GetURLReply>
The returned URL can then be plugged into Microsoft Windows Media Player. The following code snippet shows how:
Importing WMPLib; // the dll is %windir%\system32\wmpl.dll
WMPLib.WindowsMediaPlayer player = null;
public void ViewResource(string url)
{
player = new WMPLib.WindowsMediaPlayer();
player.openPlayer(url);
}
A client application can also let a user save the recording to a local drive for viewing at a later time. This requires that the client application make an explicit (HTTPS GET) request to the conference center to retrieve the stream containing the recording.
The following is C# implementation of the HTTPS GET request for downloading a resource stream from a conference center.
public Stream GetResource(string url)
{
// Get resource using HTTP GET with the url of a resource;
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(url);
myReq.Method = "GET";
Stream respStream = null;
HttpWebResponse myResp = null;
myResp = (HttpWebResponse)myReq.GetResponse();
if (myResp.ContentType == "application/octet-stream")
{
respStream = myResp.GetResponseStream();
}
return respStream;
}
The stream can then be saved to a file. The following is one example in C#.
public void DownloadResource(string url, string filePath)
{
Stream res = GetResource(url);
if (res == null)
return;
FileStream fileStream = new FileStream(filePath,
FileMode.OpenOrCreate);
int length = 1024;
Byte[] buffer = new Byte[length];
int bytesRead = res.Read(buffer, 0, length);
while (bytesRead > 0)
{
fileStream.Write(buffer, 0, bytesRead);
bytesRead = res.Read(buffer, 0, length);
}
fileStream.Close();
res.Close();
}