MergeExternalManifest Method

Replaces some elements of the main manifest with others from an external manifest or adds new elements to the main manifest.

Namespace:  Microsoft.Web.Media.SmoothStreaming
Assembly:  Microsoft.Web.Media.SmoothStreaming (in Microsoft.Web.Media.SmoothStreaming.dll)

public void MergeExternalManifest(
	Object externalManifest
)

Parameters

externalManifest
Type: System..::..Object
An object that represents the external manifest, as returned by the ParseExternalManifest()()()() method.

For more information and for examples, see Manifest Merge (IIS Smooth Streaming).

Applications can call MergeExternalManifest only from the ManifestMerge event handler. Outside the scope of this method, MergeExternalManifest throws an InvalidOperationException.

The MergeExternalManifest method integrates data in the client manifest with new XML data specified by the externalManifest parameter, which is the parsed data obtained from a previous call to ParseExternalManifest.

The following example shows how to use the method to assign a delegate.

 SmoothPlayer.ManifestMerge += 
    new SmoothStreamingMediaElement.ManifestMergeHandler(SmoothPlayer_ManifestMerge);

The following example shows an implementation of the SmoothPlayer_ManifestMerge delegate that includes options to load supplementary manifest data from sources represented by the mediaSelection variable, which is an integer assigned when the source is selected. The methods that load the new data can load manifest data from two sources and initialize the parsedExternManifest and parsedExternManifest2 objects. For more information, see Manifest Merge (IIS Smooth Streaming).

    void SmoothPlayer_ManifestMerge(SmoothStreamingMediaElement ssme)
    {
        // Out parameter for ParseExternalManifest function.
        object parsedExternManifest = null;
        object parsedExternManifest2 = null;

        try
        {
            if (mediaSelection.Equals(0))
            {
                Uri uriExtManifest = new Uri("http://<serverName>/BigBuckBunnyCaptions.xml");
                SmoothPlayer.ParseExternalManifest(uriExtManifest, 3000, out parsedExternManifest);
                SmoothPlayer.MergeExternalManifest(parsedExternManifest);
            }

            if (mediaSelection.Equals(1))
            {
    
                Uri uriExtManifest = new Uri("http://<serverName>/AdrenalineRush.xml");
                SmoothPlayer.ParseExternalManifest(uriExtManifest, 3000, out parsedExternManifest);
                SmoothPlayer.MergeExternalManifest(parsedExternManifest);

                Uri uriExtManifest2 = new Uri("http://<serverName>/AdrenalineRushCaptions.xml");
                SmoothPlayer.ParseExternalManifest(uriExtManifest2, 3000, out parsedExternManifest2);
                SmoothPlayer.MergeExternalManifest(parsedExternManifest2);
            }
        }
        catch(Exception ex )
        {
            OutputText.Text = ex.Message + " Inner Exception: " + ex.InnerException;
        }
    }

Silverlight

Supported in: 4

Show: