Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Azure

Using BLOB storage as a media server (part 1) - Building a Silverlight or WPF video player

3/16/2011 6:19:08 PM
- Windows 10 Product Activation Keys Free 2019 (All Versions)
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
In this section, we’ll return to our podcasting example. Previously, you’ve used BLOB storage as a place to store your video and audio podcasts; now you’re going to use BLOB storage as a mechanism for serving your videos to customers.

Because BLOB storage provides a URI for any files held in public containers, you could just make the link available to your customers to download the files offline, for example, http://storageaccount.blobs.core.windows.net/container/mypodcast.wmv. This probably wouldn’t provide the greatest user experience in the world.

An alternative to downloading an entire media file is to use streaming. When media is streamed, the streaming server starts sending a byte stream of the video to the client. The client media player creates a buffer of the downloaded bytes, and starts playing the video when the buffer is sufficiently full. While the user is watching the video from the buffer, the client continues to download the data in the background.

Media streaming lets the user start watching the video within seconds, rather than requiring the user to wait for the entire movie to download. If the user decides to watch only the first few seconds of the movie, the service provider will have served up only some of the movie, which results in cheaper bandwidth bills. Unfortunately, streaming isn’t currently available as an option in Windows Azure and the Windows Azure BLOB storage service. If you want to use such a solution, you need to use a third-party streaming service.

An even better solution is to use progressive downloading, in which a file is downloaded in small chunks and is stitched together by the client application. After a few chunks are downloaded, the client application can start playing the movie while the rest of the file chunks are downloaded in the background. Progressive downloading has the same performance advantages as streaming and provides a similar user experience. The main difference between progressive downloading and streaming is that the file being streamed never physically resides on disk and remains only in memory.

1. Building a Silverlight or WPF video player

By default, Silverlight supports the ability to progressively download files. In this example, we’ll tell you how to build a small Silverlight video player that will allow you to play movies on your web page that are hosted by BLOB storage. Figure 1 shows a small video player that you’ll build. The video player is playing a video served directly from BLOB storage using the public URI.

Figure 1. WPF video player showing a video that features a giant bunny rabbit (Big Buck Bunny)


You can build a WPF or Silverlight media player like that shown in figure 10.9 by creating a WPF or Silverlight application and using the following XAML:

<MediaElement x:Name="myVideo" Source="http://storageaccount.blobs.core.windows.net/container/videopodcast01.wmv"
/>


Wow, is that really it? Yup, that’s how easy it is to create a progressive downloading video player that shows videos hosted in BLOB storage.

Although Silverlight does progressively download the video player, the download is performed in a linear fashion, downloading from a single file, from a single website. If you have very large files (they’re up to gigabytes), you might want to use a slightly different technique. For large files, you can download video much faster if you split up and chunk your files manually (and eventually split them across multiple servers).

Other -----------------
- Hosting Silverlight applications in BLOB storage (part 2) - Communicating with third-party sites
- Hosting Silverlight applications in BLOB storage (part 1) - Hosting the Silverlight Spectrum emulator
- Hosting static HTML websites (part 2) - Publishing your website to BLOB services
- Hosting static HTML websites (part 1) - Creating a static HTML website
- Performing storage account operations using REST (part 3) - Creating a table using the REST API
- Performing storage account operations using REST (part 2) - Deleting tables using the REST API & WCF Data Services and AtomPub
- Performing storage account operations using REST (part 1) - Listing tables in the development storage account using the REST API
- Doing CRUDy stuff with the Table service (part 3) - Deleting entities & Updating entities
- Doing CRUDy stuff with the Table service (part 2) - Adding entities & Listing entities
- Doing CRUDy stuff with the Table service (part 1) - Creating a context class
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
Celebrity Style, Fashion Trends, Beauty and Makeup Tips.
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server