public void OpenPeerCastUri(string peercast_uri)
{
var match = Regex.Match(peercast_uri, @"peercast://(pls/)?(.+)$");
if (match.Success && match.Groups[2].Success && peerCast.OutputListeners.Count>0) {
var channel = match.Groups[2].Value;
var endpoint = peerCast.OutputListeners[0].LocalEndPoint;
string pls;
if (endpoint.Address.Equals(System.Net.IPAddress.Any)) {
pls = String.Format("http://localhost:{0}/pls/{1}", endpoint.Port, channel);
}
else {
pls = String.Format("http://{0}/pls/{1}", endpoint.ToString(), channel);
}
System.Diagnostics.Process.Start(pls);
}
}