-4

Need check if radio play, and reload if not

class Program
{
    Random random = new Random();
    StringBuilder s = new StringBuilder();
    static void Main()
    {
        Console.BackgroundColor = ConsoleColor.DarkBlue;
        Console.ForegroundColor = ConsoleColor.Green;
        WindowsMediaPlayer WMPs = new WMPLib.WindowsMediaPlayer(); //создаётся плеер 
        WMPs.settings.volume = 100;
        WMPs.URL = "http://stream.brandradionetworks.com:8000/citrus";
        WMPs.controls.play(); // start playing
        Time();
        Console.ReadKey();
    }
}
Jonas
  • 121,568
  • 97
  • 310
  • 388

1 Answers1

1

You can find out if it is playing (or waiting, buffering etc) by using the playState property.

"Playing" is the value 3, so for example:

if (WMPs.playState != 3)
{
    // handle it not playing
}

See also the PlayStateChanged event which will allow you to handle this a bit more elegantly.

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64