streaming state gets stuck at "opening"
Last post 05-09-2008 4:20 PM by VariousArtist. 1 replies.
Sort Posts:
04-29-2008 8:30 PM
streaming state gets stuck at "opening"

Has anyone run into this problem? Here is my xaml...

<MediaElement
    x:Name="MediaPlayer"
    Source="http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan1v.asf"
    Width="268" Height="151"
    CurrentStateChanged="media_state_changed" AutoPlay="False" MediaFailed="handleMediaFailed">
    
    <MediaElement.RenderTransform>

              <TranslateTransform x:Name="METransform" />
       </MediaElement.RenderTransform>

And here is my "media_state_changed" function...

function media_state_changed(sender, args)
{
   // Get the TextBlock object to display the current status.
   var mediaStateTextBlock = sender.findName("mediaStateTextBlock");
 
   // Get the MediaElement object
   var media = sender.findName("MediaPlayer");

   mediaStateTextBlock.Text = media.CurrentState;
    if ((mediaStateTextBlock.Text == "Opening") || (mediaStateTextBlock.Text == "Buffering") || (mediaStateTextBlock.Text == "Closed")) { sender.findName("btn_stop").opacity = 0.5; sender.findName("btn_play").opacity = 0.5; sender.findName("btn_stop").Cursor = "Arrow"; sender.findName("btn_play").Cursor = "Arrow";}
 if ((mediaStateTextBlock.Text == "Stopped") || (mediaStateTextBlock.Text == "Paused")) {mediaStateTextBlock.Text = ""; sender.findName("btn_stop").opacity = 0.4; sender.findName("btn_play").opacity = 0.75; sender.findName("btn_stop").Cursor = "Arrow"; sender.findName("btn_play").Cursor = "Hand";}
   if (mediaStateTextBlock.Text == "Playing") {mediaStateTextBlock.Text = ""; sender.findName("btn_stop").opacity = 0.75; sender.findName("btn_play").opacity = 0.4; sender.findName("btn_play").Cursor = "Arrow"; sender.findName("btn_stop").Cursor = "Hand";}
  
}

The function doesn't do much other than change the visible state of the play and stop buttons and hide or display the streaming state text.

The problem I have been running into is that the stream state indicator gets stuck at "Opening" and the stream never starts. However, when I try the same streaming link in Windows Media Player, it proceeds to the buffering state and plays the stream.

Strangely, this problem does not seem to occur all the time. Has anyone come across this issue or does anyone know of a solution?

Thanks!

rumremix

Joined on 10-19-2007
Posts 41
05-09-2008 4:20 PM
Re: streaming state gets stuck at "opening"

I have just started seeing this problem occur within the last couple of weeks -- curiously around the same time as your post.  Many months ago I put in code to skip past any ASX file that couldn't be opened for any reason (typically due to the video inside the ASX file being unavailable), and go onto the next ASX file I had in the queue.  This no longer happens -- it just stays stuck on "Opening".

 

Could this be somehow related to an update in one of the core files for Silverlight?  Just trying to think what else changed, because I went back to older versions of my code and they exhibit the same new issue of being stuck on "Opening" for thos unavailable videos...

VariousArtist

Joined on 10-16-2007
Posts 23