![]() Private void PlayButton_Loaded(object sender, RoutedEventArgs e) You will need a reference to the Smooth Streaming assembly. The logic for Play and Stop is shown in the following excerpt from the code file. A combo box supports a list of options to play media from several Smooth Streaming sources. The following XAML syntax includes buttons that start, stop, and pause the media stream, and a slider bar that is data-bound to the Volume property of the SmoothStreamingMediaElement. Silverlight controls can interact with Smooth Streaming media as needed for applications. This avoids reformatting that will unnecessarily consume processor resources. Instead, allow the video display to run at the size it was encoded. ![]() It is preferable to not specify height and width dimensions for the media element. You don't have to add anything to the code-behind file to start the stream. When the AutoPlay property of the SmoothStreamingMediaElement is set to true as in this example, the few lines of XAML shown above are sufficient to run Smooth Streaming media from any Silverlight-enabled Web browser. xap to :\inetpub\wwwroot (You will need administrator credentials to add files to inetpub\wwwroot). BigBuckBunny.ism/Manifest" Grid.Row="0" />īuild the application, and copy TestPage.html and. ism file on your IIS default Web site as shown in the following example. To run the example in this topic, set the SmoothStreamingSource property to the. The client manifest contains metadata about audio, video, and text streams. The client manifest has the file name extension. ism file is the server manifest that contains a list of multiple-bitrate media files and an identifier that points to the client manifest. With the reference in place, all you need is a line that adds the media element to the page and assignment of the SmoothStreamingSource property to a file with the file name extension. All other libraries needed for this application are supplied by the Visual Studio Silverlight template.Īdd the following line to MainPage.xaml to include the N: namespace. You can find the DLL in the folder where the Smooth Streaming Client is installed. To use Smooth Streaming, add a reference to the .dll. Silverlight supports both the and SmoothStreamingMediaElement. When the template completes and the project opens, you should see a display that looks like the following MainPage.xaml example. This page will be named TestPage.html and can be copied with the. Instead, let the build process generate a test page. Clear the check box that indicates the option to host the Silverlight application in a new Web site. Project WorkspaceĬreate a new Silverlight project In Visual Studio or Visual Studio Web Developer. The example in the current topic does not require cross-domain configuration unless you have to run the sample with the ASP.NET development server. (For information about running cross-domain applications, see HTTP Communication and Security with Silverlight and Test and Debug Applications. A Silverlight application that uses Smooth Streaming media data will not run on the Visual Studio ASP.NET development server without cross-domain configuration. Setting up the development environment for a Smooth Streaming client requires attention to the domain requirements of Silverlight applications. You can create Smooth Streaming content with Expression Encoder® or other tools that are provided by Smooth Streaming Partners. This enables the Silverlight application to run in the same domain and on the same port as the Smooth Streaming media.įor basic information about installing Silverlight and the Microsoft Web Platform, see Get Started with Silverlight. xap file and the TestPage.html file that hosts the application to the default Web site that contains the Smooth Streaming files. After you have built the project shown in this topic, copy the Silverlight. To get a Smooth Streaming client application running, turn on Internet Information Services (IIS) from the Control Panel of your development computer and add the multiple-bitrate files and the manifest files of the Smooth Streaming content to the default Web site in IIS. Internet Information Services® (IIS) and IIS Media Services must be installed on the Web server computer. The DLL that contains the libraries is installed with the Smooth Streaming Client. Interaction with the data stream uses other classes from the namespace. ![]() The media client for this type of application is an instance of the SmoothStreamingMediaElement class. You can build a Silverlight application that displays and interacts with Smooth Streaming media content by using the Microsoft® Silverlight® 5 SDK and Microsoft Visual Studio® or Visual Studio Web Developer Edition®.
0 Comments
Leave a Reply. |