• Live Smooth Streaming: How-to: Retrieve the configuration settings programmatically

    Published by on April 17th, 2009 4:39 am under Adaptive Streaming, IIS7, Live Smooth Streaming, Media, RSCA, Smooth Streaming


    In my previous post, I explained how the Microsoft.Web.Administration API of IIS7 helped us to manage the Live Smooth Streaming Publishing Points programmatically. In this post I’m going to show you how, using the same API, you can retrieve the Live Smooth Streaming configuration settings.

    First, let’s take a look at the Live Smooth Streaming configuration settings window


    The main idea here is to read the Live Streaming configuration section and get the attributes values from there. The piece of code looks like:

    const string LiveStreamingSectionPath = "system.webServer/media/liveStreaming";
    ServerManager serverManager = new ServerManager();
    Configuration configuration = serverManager.GetApplicationHostConfiguration();
    ConfigurationSection section = configuration.GetSection(LiveStreamingSectionPath);
    if (section != null)
        foreach (ConfigurationAttribute attribute in section.Attributes)
            Console.WriteLine("{0}: {1}", attribute.Name, attribute.Value);

    Running the preceding code will output the following:


    As you see, reading the configuration settings is easy and can enable you different scenarios, for example, deleting the archived streams of a publishing point.
    If you want to take a look at the Live Smooth Streaming schema, go to %windir%\System32\inetsrv\config\schema and open the IISMedia_LiveStreaming_schema.xml file.

    Happy streaming!

    Tags: , , , ,