When I set my SmoothStreamingSource and then call .Play() I get the following exception...
"Play is not allowed when there is no source set."
The odd thing, is that if I handle this exception (shown in the code below), the video does start playing. Odd? According to the msdn, the SmoothStreamingSource property sets the Source property automatically so I shouldn't be getting an exception. Stepping through the code confirms that the Source property is set after setting the SmoothStreamingSource property.
I'd rather not just handle the exception and go on my merry way if this is a sign of a greater issue internally.
What's up with this? My code...
try
{
Uri uri = (Uri)((Button)source).Tag;
smoothStreamingMediaElement1.SmoothStreamingSource = uri;
if (smoothStreamingMediaElement1.SmoothStreamingSource != null)
MessageBox.Show(smoothStreamingMediaElement1.SmoothStreamingSource.ToString());
else
MessageBox.Show("SmoothStreamingSource is NULL");
smoothStreamingMediaElement1.Play();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}