views:

255

answers:

3

I'm trying to stream a live feed to a Publishing Point but keep getting 'Access is Denied' errors. I can do this just fine in the Expression Encoder application (using a valid username and password). But when I try to use the same username/password in my custom app, I get that error. I've tried pre-connecting without credentials, which fires the AcquireCredentials event.

So I know its connecting to the server just fine, but my user credentials are being denied through my custom app. Any idea what the problem is? Here's a snippet of my code (if it helps):

LiveJob job = new LiveJob();

LiveDevice audioDevice = (LiveDevice)cmbAudioDevices.SelectedItem;
LiveDevice videoDevice = (LiveDevice)cmbVideoDevices.SelectedItem;

LiveDeviceSource liveSource = job.AddDeviceSource(videoDevice, audioDevice);
job.ActivateSource(liveSource);

System.Runtime.InteropServices.HandleRef h = new System.Runtime.InteropServices.HandleRef(panel1, panel1.Handle);

job.DeviceSources[0].PreviewWindow = new PreviewWindow(h)
{
    Visible = true
};

System.Security.SecureString password = new System.Security.SecureString();
foreach (char letter in txtPassword.Text.ToCharArray())
    password.AppendChar(letter);

job.OutputFormat = new WindowsMediaPublishingPointOutputFormat()
{
    PublishingPoint = new Uri(txtPublishPoint.Text)
    UserName = txtUsername.Text,
    Password = password
};

job.PreConnectPublishingPoint();

Any thoughts?

A: 

Turns out there was a server permissions issue. Was able to install a second box connect just fine.

Colin O'Dell
A: 

Hi colinodell,

I am getting the same problem. Can you please tell me what exactly you did it to work?

Thanks and regards, SachinS

SachinS
I'm not really sure. We ended up installing a second server and it worked fine on there, so we used that machine instead. Also, there's some callback function which fires if the connection succeeds but your credentials are wrong/missing. Create a function to respond to this event to help narrow down the cause of the problem.
Colin O'Dell
A: 

How are you populating the combobox with the device sources ?

Mark Richards