Partager via


MediaStreamingManager.SetMediaStreamingEnabledAsync Method (Boolean)

 

Enables or disables media streaming on the server.

Namespace:   Microsoft.WindowsServerSolutions.MediaStreaming
Assembly:  MediaStreamingObjectModel (in MediaStreamingObjectModel.dll)

Syntax

public void SetMediaStreamingEnabledAsync(
    bool enable
)
public:
void SetMediaStreamingEnabledAsync(
    bool enable
)
Public Sub SetMediaStreamingEnabledAsync (
    enable As Boolean
)

Parameters

  • enable
    Type: System.Boolean

    true to enable media streaming; otherwise false.

Examples

The following code example shows how to asynchronously enable media streaming:

MediaStreamingManager msm = new MediaStreamingManager();

msm.SetMediaStreamingEnabledAsyncCompleted += 
   new EventHandler<MediaStreamingEnabledAsyncCompletedEventArgs>(
      msm_SetMediaStreamingEnabledAsyncCompleted); 
msm.SetMediaStreamingEnabledAsync(true);

The following code example shows how to implement the delegate method:

static void msm_SetMediaStreamingEnabledAsyncCompleted(object sender, 
   MediaStreamingEnabledAsyncCompletedEventArgs ea1)
{
   Console.WriteLine("Media Streaming Enabled = {0}", 
      ea1.Enabled.ToString());
}

See Also

MediaStreamingManager Class
Microsoft.WindowsServerSolutions.MediaStreaming Namespace

Return to top