<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Mingfei's Code Block</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mingfeis_code_block/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:24:31 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Building video application on Windows 8 – things you want to know</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/building-video-application-on-windows-8-things-you-want-to-know</link>
      <pubDate>Sat, 27 Oct 2012 11:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/10/27/building-video-application-on-windows-8-things-you-want-to-know/</guid>
      <description><![CDATA[If you want to build video applications on Windows 8 platform, you may find this blog...]]></description>
      <content:encoded><![CDATA[<p></p>
<p>If you want to build video applications on Windows 8 platform, you may find this blog useful.&nbsp;We (<a href="https://www.windowsazure.com/en-us/home/features/media-services/">Windows Azure Media Services</a>&nbsp;team) ships&nbsp;<a href="http://visualstudiogallery.msdn.microsoft.com/04423d13-3b3e-4741-a01c-1ae29e84fea6">Smooth Streaming Client SDK for Windows 8</a>&nbsp;and&nbsp;<a href="http://playerframework.codeplex.com/">Microsoft Media Platform Player&nbsp;framework</a>&nbsp;(MMPPF) in addition to Windows 8 Media Foundation to help you build rich media applications.</p>
<h4><span>Building Video application on Windows 8 - what are&nbsp;supported?&nbsp;</span></h4>
<p>If you are building a video&nbsp;application on Windows 8 and your video source is H.264 (.MP4) for instance:<img class="mceWPmore" title="More..." src="http://mingfeiy.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="Read More Here" /></p>
<ul>
<li>You could use&nbsp;<a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.mediaelement">MediaElement</a>&nbsp;class in XAML application to handle the playback. Code sample:&nbsp;</li>
</ul>
<pre class="scroll"><code class="cplusplus">&lt;MediaElement Source="Media/video1.mp4" AutoPlay="True" /&gt;</code></pre>
<ul>
<li>Or you could use &lt;video&gt; tag in HTML5 application. Code sample:&nbsp;</li>
</ul>
<pre class="scroll"><code class="cplusplus">&lt;video width="320" height="240" controls="controls"&gt; &lt;source src="movie.mp4" type="video/mp4"&gt; &lt;/video&gt;</code></pre>
<p>Here is a detail list of video format that Windows 8 playback pipeline support (<a href="http://blogs.msdn.com/b/b8/archive/2012/06/08/building-a-rich-and-extensible-media-platform.aspx">full details in Windows blog</a>) :&nbsp;</p>
<p><br /><a href="http://mingfeiy.com/wp-content/uploads/2012/10/supported-video-format.png"><img class="aligncenter  wp-image-1322" title="video format supported by Windows 8" src="http://mingfeiy.com/wp-content/uploads/2012/10/supported-video-format.png" alt="" width="554" height="232" style="display: block; margin-left: auto; margin-right: auto;" /></a></p>
<p>That's what happen when developing an application with .Mp4 URL for instance. Windows 8 Media pipeline has Decorder to decode the video, Renderer to render&nbsp;the image and Decrypter to decrypt the video if it is&nbsp;protected. As long as the video format you provides falls into the category I showed in the table above, Windows 8 Media pipeline will handle for you. Meanwhile, Windows 8 team put in a lot of efforts for optimizing all these operations to achieve battery optimization,&nbsp;hardware&nbsp;acceleration and etc.</p>
<p><br /><strong>Playing Smooth Streaming content using Smooth Streaming Client SDK for Windows 8</strong></p>
<p><span style="background-color: #ffffff; color: #3366ff;"><strong><a href="http://mingfeiy.com/building-video-application-on-windows-8-all-you-need-to-know/"><span style="background-color: #ffffff; color: #3366ff;">Read full blog here ..</span></a></strong></span></p>]]></content:encoded>
    </item>
    <item>
      <title>What is Windows Azure Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/what-is-windows-azure-media-services</link>
      <pubDate>Mon, 27 Aug 2012 12:47:23 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/08/27/what-is-windows-azure-media-services/</guid>
      <description><![CDATA[I am a program manager currently working on&nbsp;Windows Azure Media&nbsp;Services(WAMS) team. This...]]></description>
      <content:encoded><![CDATA[<p>I am a program manager currently working on&nbsp;<a href="https://www.windowsazure.com/en-us/home/features/media-services/">Windows Azure Media&nbsp;Services</a>(WAMS) team. This blog is my first tempt for trying to explain what WAMS is. We released Windows Azure Media Services Preview in June 2012. Currently we offer a&nbsp;<span>90 days free trail</span>&nbsp;period for developers. If you are a Azure&nbsp;subscriber, you have up to&nbsp;<span>1 TB encoding</span>&nbsp;volume per month. And if you are on Azure 90 days free subscription plan, you will have up to&nbsp;<span>20 GB data</span>&nbsp;in your storage account. You could check out this blog &ndash;&nbsp;<a href="http://mingfeiy.com/getting-started-windows-azure-media-services/">how to sign up for Windows Azure Media Services</a>.<span id="more-1101"></span></p>
<h4><span>What is Windows Azure Media Services</span></h4>
<div id="attachment_1102" class="wp-caption aligncenter"><a href="http://mingfeiy.com/wp-content/uploads/2012/08/WAMS.png" class="fancybox" rel="gallery"><img class="wp-image-1102 " title="Windows Azure Media Services" src="http://mingfeiy.com/wp-content/uploads/2012/08/WAMS.png" alt="" width="614" height="238" /></a>
<p class="wp-caption-text">Figure 1: Windows Azure Media Services</p>
</div>
<p>Windows Azure Media Services offers a collection of components and technologies from Microsoft and third parties to enable end-to-end media solutions, leveraging on Windows Azure platform. If you are looking for end-to-end media solution with the power of cloud computing, Windows Azure Media Services is the right service you should consider.</p>
<p>Read the full <a href="http://mingfeiy.com/what-windows-azure-media-services/">article</a>&nbsp;here.&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting started with Windows Azure Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/getting-started-with-windows-azure-media-services</link>
      <pubDate>Sun, 19 Aug 2012 16:49:04 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/08/19/getting-started-with-windows-azure-media-services/</guid>
      <description><![CDATA[This blog shows you how to request for Windows Azure Media Services Preview and create an account...]]></description>
      <content:encoded><![CDATA[<p>This blog shows you how to request for Windows Azure Media Services Preview and create an account through Windows Azure portal.</p>
<h4><span>Sign up for the preview</span></h4>
<p>1. Go to&nbsp;<a href="http://windowsazure.com/">windowsazure.com</a>&nbsp;and obtain a free-trail account or login with your own account.</p>
<p>2. Go to&nbsp;<a href="https://account.windowsazure.com/PreviewFeatures">https://account.windowsazure.com/PreviewFeatures</a>&nbsp;and that&rsquo;s where you could request for feature preview.&nbsp;<span id="more-1012"></span></p>
<p><a href="http://mingfeiy.com/wp-content/uploads/2012/07/ScreenShot235.jpg" class="fancybox" rel="gallery"><img class="alignnone  wp-image-1013" title="Request Windows Azure Media Service" src="http://mingfeiy.com/wp-content/uploads/2012/07/ScreenShot235.jpg" alt="" width="577" height="238" /></a></p>
<p>3. Click on Try it now showed in the picture above. After clicking it, you will see the following screen. Currently we offer three-months free trail and you could click on complete if you want to give it a try.</p>
<p>Continue reading <a href="http://mingfeiy.com/getting-started-windows-azure-media-services/">here</a>.&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Building Windows Store Apps with Smooth Streaming Client SDK Beta 2</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/building-windows-store-apps-with-smooth-streaming-client-sdk-beta-2</link>
      <pubDate>Tue, 14 Aug 2012 12:49:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/08/14/building-windows-store-apps-with-smooth-streaming-client-sdk-beta-2/</guid>
      <description><![CDATA[Yesterday we announced the&nbsp;release&nbsp;of Smooth Streaming Client SDK Beta 2 for Windows Store...]]></description>
      <content:encoded><![CDATA[<p>Yesterday we announced the&nbsp;<a href="http://learn.iis.net/page.aspx/1279/smooth-streaming-client-sdk-beta-2-for-windows-store-apps-release-notes/">release&nbsp;</a>of Smooth Streaming Client SDK Beta 2 for Windows Store Apps.The Smooth Streaming Client SDK Beta&nbsp;2 for Windows Store Apps enables developers to build Windows&nbsp;Store applications that can play on-demand and live Smooth Streaming content with or without Microsoft PlayReady protection.</p>
<p>This blog is a walk-through for building a &ldquo;Hello World&rdquo; version of Smooth Streaming Windows Store Apps, using JavaScript and HTML5. This sample application uses Smooth Streaming Client SDKs directly. But we also&nbsp;recommend&nbsp;you to take a look at&nbsp;<a href="http://playerframework.codeplex.com/wikipage?title=Player%20Framework%20for%20Windows%208%20Metro%20Style%20Apps&amp;referringTitle=Home">Microsoft Media Platform Player Framework for Windows 8</a>, which is a player framework built on top of client SDKs. It is very easy to use for you to build rich video applications. If you are using earlier version of Client SDK, you could refer to this&nbsp;<a href="http://blogs.iis.net/cenkd/archive/2012/03/28/How-to-build-your-first-html5-metro-style-smooth-streaming-player.aspx">blog</a>.</p>
<p>Continue reading <a href="http://mingfeiy.com/building-windows-store-apps-smooth-streaming-client-sdk-beta-2/">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Smooth Streaming Client v2.0 walkthrough: How to figure out when data chunk failed to be downloaded</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/smooth-streaming-client-v2-0-walkthrough-how-to-figure-out-when-data-chunk-failed-to-be-downloaded</link>
      <pubDate>Sun, 03 Jun 2012 16:31:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/06/03/smooth-streaming-client-v2-0-walkthrough-how-to-figure-out-when-data-chunk-failed-to-be-downloaded/</guid>
      <description><![CDATA[This blog belongs to a series of Smooth Streaming Client v2.0 walkthroughs. You could download...]]></description>
      <content:encoded><![CDATA[<p></p>
<p></p>
<p></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">This blog belongs to a series of Smooth Streaming Client v2.0 walkthroughs. You could download this latest Smooth Streaming Client SDks <a href="http://www.iis.net/download/SmoothClient">here</a>. We have made a few major changes in this version. In this blog, I will introduce to you how to figure out data chunk information while you are downloading it.&nbsp;<br /><br />While playing smooth streaming content, you could utilize ChunkDownloadedEventArgs to figure out downloaded chunk information, such as whether data chunk is successfully downloaded, what type of data chunk is, what duration the chunk has and etc. This is very useful for you to monitor data chunk download progress. If you find something wrong, you don&rsquo;t have to wait the downloader to keep retrying, rather you could route to other media source for instance.</span></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">Here is all the information you could get from ChunkDownloadedEventArgs:</span></p>
<pre class="scroll"><span style="font-size: small;"><code class="csharp"> public class ChunkDownloadedEventArgs : EventArgs<br /> {<br /> public Uri CanonicalUri { get; }<br /> public ChunkInfo Chunk { get; }<br /> public ChunkResult.ChunkResultState DownloadResult { get; }<br /> public ChunkRequestType RequestType { get; }<br /> public HttpStatusCode StatusCode { get; }<br /> public TrackInfo Track { get; }<br /> }</code></span></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">You could refer to the table below for more information.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/4130.ScreenShot128.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/4130.ScreenShot128.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/4130.ScreenShot128.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x248/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/4130.ScreenShot128.jpg" /></a></p>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">The way to implement ChunkDownloadedEventArgs is quite straight forward. Firstly, we need to hook up ChunkDownloadedEventArgs with smooth streaming player.&nbsp;</span></p>
<pre class="scroll"><code class="csharp">SmoothPlayer.ChunkDownloadFailed += new EventHandler&lt;ChunkDownloadedEventArgs&gt;(SSME_ChunkDownloadFailed);</code><span style="font-family: trebuchet ms,geneva; font-size: small;"></span></pre>
<p><span style="font-family: trebuchet ms,geneva; font-size: small;">Here I implement a method to read out all the useful information from the event args.</span></p>
<p></p>
<pre class="scroll"><span style="font-size: small;"><code class="csharp"> private void SSME_ChunkDownloadFailed(object sender, ChunkDownloadedEventArgs args)<br /> {<br /> {<br /> statusTxt.Text = "The actual request type is " + args.RequestType+"\n";<br /> if (args.Chunk != null)<br /> {<br /> statusTxt.Text += "chunk is not null"+"\n";<br /> statusTxt.Text += "chunk duration is " + args.Chunk.Duration + "\n";<br /> statusTxt.Text+="chunk time stamp is "+args.Chunk.TimeStamp+"\n";<br /> statusTxt.Text += "chunk stream is " + args.Chunk.Stream + "\n";<br /> }<br /> <br /> if (args.Chunk.Stream != null)<br /> {<br /> statusTxt.Text += "chunk's stream is not null"+"\n";<br /> }<br /> statusTxt.Text+="This chunk is "+ args.Chunk.Stream.Type+"\n";<br /> if (args.Track != null)<br /> {<br /> statusTxt.Text += "track is not null"+"\n";<br /> }<br /> statusTxt.Text+="The result is "+ args.DownloadResult+"\n";<br /> statusTxt.Text += "The result is " + args.StatusCode+"\n";<br /> };<br /> }<br /> </code></span></pre>]]></content:encoded>
    </item>
    <item>
      <title>Assign media url in code behind for SmoothStreamingMediaElement</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/assign-media-url-in-code-behind-for-smoothstreamingmediaelement</link>
      <pubDate>Thu, 10 May 2012 18:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/05/10/assign-media-url-in-code-behind-for-smoothstreamingmediaelement/</guid>
      <description><![CDATA[In this short blog, I will talk about how to assign media url in code behind for SSME:...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">In this short blog, I will talk about how to assign media url in code behind for SSME: SmoothStreamingMediaElement. For this code sample, I am not using&nbsp;Microsoft Media Platform: <a href="http://smf.codeplex.com/">Player Framework v2.6</a>. I am building the application from scratch using <a href="http://www.iis.net/download/SmoothClient">Silverlight Smooth Streaming Client v1.5</a>. I hope this short blog will help you while debugging.<br /></span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">1. You will need to add the player in .xaml file. I didn't set the streaming source in SmoothStreamingMediaElement in .xaml file. </span></p>
<p></p>
<pre class="scroll"><span style="font-size: small;"><code class="html">&lt;SSME:SmoothStreamingMediaElement AutoPlay="false" x:Name="SmoothPlayer" Grid.Row="0" /&gt;</code></span></pre>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">2. And go to the code behind, and insert the following code<br /></span></p>
<pre class="scroll"><span style="font-size: small;"><code class="csharp"> public MainPage()<br /> {<br /> InitializeComponent();<br /> <br /> SmoothPlayer.SmoothStreamingSource = new Uri("http://devplatem.vo.msecnd.net/Sintel/Sintel_VC1.ism/manifest");<br /> <br /> SmoothPlayer.MediaOpened += (o, e) =&gt;<br /> {<br /> SmoothPlayer.Play();<br /> };<br /> }</code></span></pre>
<p><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;">You will see from the code above, the first step is straight-forward, that we assign the media source URI to SmoothStreamingSource. However, if now, you immediately call SmoothPlayer.Play(), you will get an error. That's because when media source gets set up, Smooth Streaming player will do a bunch of things, such as downloading manifest and downloading some amount of data chunks. Thus, initially I called SmoothPlayer.Play() after ManifestReady() event, that's also wrong. Because Smooth Streaming player still needs to validate the media stream and read the file reader. However, MediaOpened event&nbsp;guaranteed&nbsp;all these. For details, you could read on MediaOpened() MSDN documentations <a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.smoothstreamingmediaelement.mediaopened(v=vs.90).aspx">here</a>.&nbsp;<br /></span></p>
<p><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;">In addition, if you want to read more about how we design different state of the media elements, you could read MSDN documents <a href="http://msdn.microsoft.com/en-us/library/ff728115(v=VS.90).aspx">Media Element State Transitions</a>. &nbsp;</span></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Smooth Streaming Cache Plug-in implementation</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/smooth-streaming-cache-plug-in-implementation</link>
      <pubDate>Mon, 09 Apr 2012 16:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/04/09/smooth-streaming-cache-plug-in-implementation/</guid>
      <description><![CDATA[When you implement a video player, it is good to use cache to store played video fragments....]]></description>
      <content:encoded><![CDATA[<p><span face="'trebuchet ms', geneva" size="3" style="font-family: 'trebuchet ms', geneva; font-size: small;">When you implement a video player, it is good to use cache to store played video fragments. Therefore, user doesn't need to download manifest or data chunks&nbsp;from server multiple times. It saves network consumption for your users and reduce the latency since they don't need to download from server all the time. Meanwhile, using cache reduces server load for content provider as well. If you use<a href="http://www.iis.net/download/SmoothClient" target="_blank"> Smooth Streaming Client</a>, here is how you could implement a cache plug-in to cache data.</span></p>
<p><span face="'trebuchet ms', geneva" size="3" style="font-family: 'trebuchet ms', geneva; font-size: small;">The IIS Smooth Streaming Client provides the <a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.ismoothstreamingcache(v=vs.90).aspx" target="_blank">ISmoothStreamingCache </a>interface to support offline scenarios. Here is how it works in high level.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><span face="'trebuchet ms', geneva" size="3">When user starts to play video, Silverlight Smooth Streaming Client will check with Isolated Storage Instance (this isolated storage is within Silverlight player) to see whether there is video manifest or data chunks&nbsp;available to read. If not, Isolated Storage Instance will return a NULL as CacheResponse. Now, client knows there is no cache available for retrieving, then, it will go ahead to talk to server for getting manifest/data chunks, and stored it in the cache for next-time use</span>. Here is a high level diagram for this conversation.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2526.Cache.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2526.Cache.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2526.Cache.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2526.Cache.jpg" border="0" alt="" /></a><br /></span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Second time, since we have saved data into cache (isolated storage), when client check with cache using BeginRetrieve(), cache will give back the data in EndRetrieve(). Client won't need to make a request to server in this case.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/0523.cache2.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0523.cache2.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/0523.cache2.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0523.cache2.jpg" border="0" alt="" /></a><br /></span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Here is a detailed documentation on how to <a href="http://msdn.microsoft.com/en-us/library/gg296362(v=vs.90).aspx">implement Cache Plugin-in</a> on MSDN.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">I did a simplified version for demo purpose and you could download it <a href="https://skydrive.live.com/redir.aspx?cid=dda82aac0ac4fe4d&amp;resid=DDA82AAC0AC4FE4D!1086&amp;parid=DDA82AAC0AC4FE4D!1084">here</a>. And let's explain the code in steps.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;"></span><span style="font-family: 'trebuchet ms', geneva; font-size: small;">0. This project is based on </span><a href="http://www.iis.net/download/SmoothClient" target="_blank" style="font-family: 'trebuchet ms', geneva; font-size: small;">Smooth Streaming Client </a><span style="font-family: 'trebuchet ms', geneva; font-size: small;">1.5. For setting up instruction, please refer to my another </span><a href="http://blogs.msdn.com/b/mingfeis_code_block/archive/2012/04/01/getting-started-for-building-a-smooth-streaming-client.aspx" style="font-family: 'trebuchet ms', geneva; font-size: small;">blog post</a><span style="font-family: 'trebuchet ms', geneva; font-size: small;">.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">1. In MainPage.xaml, a smooth streaming player is created:&nbsp;</span></p>
<pre class="scroll"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><code class="html"> &lt;SSME:SmoothStreamingMediaElement AutoPlay="false" x:Name="SmoothPlayer" SmoothStreamingSource="http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest" Grid.Row="0" /&gt;<br /></code></span></pre>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">2. And in MainPage.xaml, there are only "Play" button, "Stop" button and "Clear Cache" button. </span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">3. Open MainPage.xaml.cs, and here are all the methods listed in this file. (Click to view a larger image)</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2350.ScreenShot013.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2350.ScreenShot013.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2350.ScreenShot013.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x1000/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2350.ScreenShot013.jpg" border="0" alt="" /></a><br /></span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">4. If you open SmoothPlayer_Loaded(obejct sender, RoutedEventArgs e) method, you will see:&nbsp;</span></p>
<pre class="scroll"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><code class="csharp"> void SmoothPlayer_Loaded(object sender, RoutedEventArgs e)<br /> {<br /> cache = new ISO_StorageCache();<br /> SmoothPlayer.SmoothStreamingCache = cache;<br /> }</code></span></pre>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Basically, when ISO_StorageCache getting initialized, we will create a Isolated Storage file for storing manifest and data chunks. The URL/file name pairs stored in the IsolatedStorageSettings.ApplicationSettings object are read into a dictionary object when the cache is instantiated, and the dictionary pairs are used to identify data files in the cache. Here is the code:</span></p>
<pre class="scroll"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><code class="csharp"> public ISO_StorageCache()<br /> {<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span>IsolatedStorageFile isoFileArea = IsolatedStorageFile.GetUserStoreForApplication();<br /> <br /><span class="Apple-tab-span" style="white-space: pre;"> </span>foreach (System.Collections.Generic.KeyValuePair&lt;string, object&gt; pair in IsolatedStorageSettings.ApplicationSettings)<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span>{<br /><span class="Apple-tab-span" style="white-space: pre;"> </span> if (!keyUrls.ContainsValue((string)pair.Value) &amp;&amp; isoFileArea.FileExists((string)pair.Value))<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span> KeyUrls.Add(pair.Key, ((string)pair.Value));<br /> <span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /> }</code></span></pre>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">5. Still looking at SmoothPlayer_Loaded method, "SmoothPlayer.SmoothStreamingCache=cahe". In this line,an ISmoothStreamingCache object is started and a request for data is issued, the Silverlight Smooth Streaming Client will call each of the methods in the order: BeginRetrieve, EndRetrieve, BeginPersist, EndPersist as showed above. And I have explained the use of these four methods at the beginning.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">6. At the end, if you want to modify the result(manifest or data chunks) before going into cache, you could catch the <a href="http://msdn.microsoft.com/en-us/library/microsoft.web.media.smoothstreaming.cacheresponse(v=vs.90).aspx">CacheResponse</a> before it is saved into Isolated Storage file in EndPersist() method. CacheResponse will give you information for your content type, a response(manifest or data chunks) in stream format and header.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;">7. I often hit the problem that isoFile size is not enough and you could increase isoFile's size in EndPersist() by adding the following line. Or you could press the clean cache button.&nbsp;</span></p>
<pre class="scroll"><span style="font-family: 'trebuchet ms', geneva;"><code class="csharp"> /*Increase ISOFileArea size*/<br /> long availbleCacheBytes = isoFileArea.AvailableFreeSpace;<br /> long saveQuotaNumber = isoFileArea.Quota;<br /> <br /> isoFileArea.IncreaseQuotaTo(isoFileArea.Quota + 1048576);</code></span></pre>
<pre>            </pre>]]></content:encoded>
    </item>
    <item>
      <title>Getting Started for building a smooth streaming client</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/getting-started-for-building-a-smooth-streaming-client</link>
      <pubDate>Sat, 31 Mar 2012 12:30:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2012/03/31/getting-started-for-building-a-smooth-streaming-client/</guid>
      <description><![CDATA[There are two types of developments for building a Smooth Streaming Client:

IIS Smooth Streaming...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: 'trebuchet ms', geneva; font-size: small;">There are two types of developments for building a Smooth Streaming Client:</span></p>
<ul>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><strong><a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/IIS Smooth Streaming Client 1.5 APIs" title="http://msdn.microsoft.com/en-us/library/ee958035(v=VS.90).aspx" target="_blank">IIS Smooth Streaming Client 1.5 APIs</a></strong>&nbsp;: developers could utilize these APIs to build applications on Silverlight platform (runs on desktop,Xbox or Windows phone). These APIs is formally known as "Smooth Streaming Player Development Kit</span></li>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><strong>Microsoft Media Platform - <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Player Framework v2.6" title="http://smf.codeplex.com/" target="_blank">Player Framework v2.6</a></strong> : a open source framework. It includes sample player and numbers of plugins for developers to get quick started. And MMPPF is based on IIS Smooth Streaming Client APIs.&nbsp;</span></li>
</ul>
<div><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;">This blog is for developers who want to build media player based on IIS Smooth Streaming Client APIs, instead of utilizing the framework.&nbsp;</span></div>
<div></div>
<div><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;">Pre-request:&nbsp;</span></div>
<div>
<ul>
<li><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: small;">Install Smooth Streaming APIs:&nbsp;<a href="http://www.iis.net/download/SmoothClient">http://www.iis.net/download/SmoothClient</a></span></li>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Install Silverlight Development Runtime:&nbsp;<a href="http://www.silverlight.net/downloads">http://www.silverlight.net/downloads</a>&nbsp;I installed Silverlight 5 Tool for Visual Studio 2010 SP</span></li>
</ul>
</div>
<div><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Now we will build a <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Smooth Streaming" title="http://www.iis.net/download/SmoothStreaming" target="_blank">Smooth Streaming</a> Client step by step:</span></div>
<div></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"></span><span style="font-family: 'trebuchet ms', geneva; font-size: small;">1. Open Visual Studio. Select New Project... and Select Siverlight Application under Visual C# section. I choose PlayerDemo1 as the project name.&nbsp;</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"></span><span style="font-family: 'trebuchet ms', geneva; font-size: small;">2. Choose Host the Silverlight application in a new Web site.</span></div>
<div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;">&nbsp;</span> <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1108.ScreenShot002.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1108.ScreenShot002.bmp" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x350/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp" border="0" alt="" /></a></div>
<div style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1108.ScreenShot002.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1108.ScreenShot002.bmp"></a>3. &nbsp;<span style="font-family: 'trebuchet ms', geneva; font-size: small;">Now you could see two projects are generated in Solution Explorer. PlayDemo1 is the Silverlight application with XAML files. And PlayerDemo1.Web is a web application project with HTML page, which &nbsp; contain the Silverlight component you built in PlayerDemo1. If you build this application now, you will see a PlayerDemo1.xap get generated in ClientBin under PlayerDemo1.Web project.&nbsp;</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2870.ScreenShot004.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2870.ScreenShot004.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/2870.ScreenShot004.bmp" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x200/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/2870.ScreenShot004.bmp" border="0" alt="" /></a><br /></span></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;">4. Right click on References fold under PlayerDemo1 project, choose Add Reference...</span></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/6567.ScreenShot005.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/6567.ScreenShot005.bmp" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x150/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp" border="0" alt="" /></a></span></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/6567.ScreenShot005.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6567.ScreenShot005.bmp"><br /></a></span></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;">5. When you install Smooth Streaming APIs, the APIs are resided at /%SystemDrive%/Program Files(x86)/Microsoft SDKs/IIS Smooth Streaming Client/v1.5/Silverlight. And choose&nbsp;Microsoft.Web.Media.SmoothStreaming.dll.&nbsp;</span></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;">6. Add namespace in MainPage.xaml under PlayerDemo1 project. &nbsp;</span></div>
<div style="padding-left: 30px;"><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: x-small;"><span face="'trebuchet ms', geneva" size="2" style="font-family: 'trebuchet ms', geneva; font-size: x-small;"><span></span></span></span>
<pre class="scroll"><code class="csharp">xmlns:SSME="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming" </code></pre>
</div>
<div style="padding-left: 30px;"></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva;">7. Add XAML for the media player and the whole MainPage.xaml should look like this:</span></div>
<div style="padding-left: 30px;">
<pre class="scroll"><code class="csharp">&lt;UserControl x:Class="PlayerDemo1.MainPage"<br /> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br /> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br /> xmlns:d="http://schemas.microsoft.com/expression/blend/2008"<br /> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"<br /> xmlns:SSME="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming" <br /> mc:Ignorable="d"<br /> d:DesignHeight="640" d:DesignWidth="480"&gt;<br /> <br /> &lt;Grid x:Name="LayoutRoot"&gt;<br /> &lt;SSME:SmoothStreamingMediaElement AutoPlay="True" x:Name="SmoothPlayer" SmoothStreamingSource="http://streams.smooth.vertigo.com/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest" Grid.Row="0" /&gt;<br /> &lt;/Grid&gt;<br /> &lt;/UserControl&gt;</code></pre>
</div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;">8. Lastly, press F5 and you will compile the project and see a simple smooth streaming client.&nbsp;</span></div>
<div style="padding-left: 30px;"><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/7506.ScreenShot007.bmp" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7506.ScreenShot007.bmp"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/7506.ScreenShot007.bmp" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x300/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7506.ScreenShot007.bmp" border="0" alt="" /></a><br /></span></div>
</div>
<div></div>
<div><span style="font-family: 'trebuchet ms', geneva; font-size: small;">Some useful links: </span></div>
<div>
<ul>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;"><span face="'trebuchet ms', geneva" size="2">Smooth Streaming Deployment </span><a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Guide" title="http://www.microsoft.com/download/en/details.aspx?id=2547" target="_blank" style="font-family: 'trebuchet ms', geneva; font-size: small;">Guide</a><span face="'trebuchet ms', geneva" size="2">&nbsp;(Comprehensive&nbsp;and useful): prepare your own media source, config Smooth Streaming Server and deploy media onto your server</span></span></li>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;">IIS Smooth Streaming HD Sample <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Guide" title="http://www.microsoft.com/download/en/details.aspx?id=18199" target="_blank">Guide</a>: it provides two media sources in streaming format so you don't need to use Encoder to prepare your media</span></li>
<li><span style="font-family: 'trebuchet ms', geneva; font-size: small;">[<a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Blog" title="http://learn.iis.net/page.aspx/558/getting-started-with-iis-smooth-streaming" target="_blank">Blog</a>]Getting started with IIS Smooth Streaming: Step by Step showing you how to set up a sample Smooth Streaming&nbsp;</span></li>
</ul>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Testing Tools for web API</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/testing-tools-for-web-api</link>
      <pubDate>Sat, 30 Jul 2011 03:40:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2011/07/30/testing-tools-for-web-api/</guid>
      <description><![CDATA[Web API&rsquo;s have long been used to allow programmers access to functionality via a well defined...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: 'trebuchet ms', geneva;">Web API&rsquo;s have long been used to allow programmers access to functionality via a well defined interface without the need to understand exactly how that functionality is implemented.&nbsp;I was using Hurl and fiddler recently for Web API testing and I hope it is helpful for Web Api developers as well as consumers to test out the services.&nbsp;</span></p>
<ul>
<li><span style="font-family: 'trebuchet ms', geneva;"><span class="Apple-style-span" style="font-size: small;">Hurl: you can download at&nbsp;</span><span class="Apple-style-span" style="font-size: small;"><a href="http://hurl.it/">http://hurl.it/</a></span></span></li>
</ul>
<p><span style="font-family: 'trebuchet ms', geneva;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1106.ScreenShot787.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1106.ScreenShot787.jpg" border="0" alt="" /></span></p>
<p><span style="font-family: 'trebuchet ms', geneva;">Hurl is a Web-based tool for testing APIs. You could choose the request method, customize headers and POST parameters, add basic authorization, and follow redirects. Then view the nicely formatted request and response. It is a very clean and easy tool for testing your APIs.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/6165.ScreenShot789.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6165.ScreenShot789.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/6165.ScreenShot789.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/6165.ScreenShot789.jpg" border="0" alt="" /></a></span></p>
<p></p>
<p><span style="font-family: 'trebuchet ms', geneva;">Here is the Twitter API reference page I used: <a href="https://dev.twitter.com/docs/api/1/get/search">https://dev.twitter.com/docs/api/1/get/search</a></span></p>
<p><span style="font-family: 'trebuchet ms', geneva;">HURL provides five HTTP methods: PUT, GET, POST, DELTE, and HEAD. And you could apply HTTP basic access authentication. You could also view request and response body in full size view (a pop up window). Another thing I like Hurl is that for response body, it highlights the contents with different colors, which made it really easy to read.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;">You could also login and after that, you could view your call history:</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/0118.ScreenShot791.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0118.ScreenShot791.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/0118.ScreenShot791.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/0118.ScreenShot791.jpg" border="0" alt="" /></a></span></p>
<p></p>
<p><span style="font-family: 'trebuchet ms', geneva;">By clicking on each URL you will be redirected back to request page with parameters you used previously. And you could repeat the test again or modify on the past test.</span></p>
<ul>
<li>
<p><span style="font-family: 'trebuchet ms', geneva;">Fiddler: you can download at&nbsp;<a href="http://www.fiddler2.com/fiddler2/">http://www.fiddler2.com/fiddler2/</a></span></p>
<span style="font-family: 'trebuchet ms', geneva;">Fiddler is a free Web Debugging Proxy which logs all&nbsp;</span><nobr>HTTP(S)</nobr><span style="font-family: 'trebuchet ms', geneva;">&nbsp;traffic between your computer and the Internet. It is a desktop application only runs on Windows Operating System.<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/8688.ScreenShot786.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8688.ScreenShot786.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/8688.ScreenShot786.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8688.ScreenShot786.jpg" border="0" alt="" /></a></span></li>
</ul>
<p><span style="font-family: 'trebuchet ms', geneva;">There are two parts of Fiddler you may be interested in immediately. Firstly, it is the request builder showed above. You could customize your request. It has almost all types of HTTP methods supported. By pressing the Execute button you will see the response return.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;">Secondly, it is the Session Inspector. By clicking on the web sessions history on the left side, you could inspect each session individually with details showed up on Inspectors.&nbsp;</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/8863.ScreenShot792.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8863.ScreenShot792.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/8863.ScreenShot792.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/8863.ScreenShot792.jpg" border="0" alt="" /></a></span></p>
<p></p>
<p><span style="font-family: 'trebuchet ms', geneva;">Another interesting feature for Fiddler is that it provides Web View, so you could see images that are returned. &nbsp;This allows you to see specifically what was returned to the browser before it was interpreted.</span></p>
<p><span style="font-family: 'trebuchet ms', geneva;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1325.ScreenShot793.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1325.ScreenShot793.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/1325.ScreenShot793.jpg" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/1325.ScreenShot793.jpg" border="0" alt="" /></a></span></p>
<p></p>
<p><span style="font-family: 'trebuchet ms', geneva;">Fiddler is a very powerful tool has much more functions than I introduced. You could refer to Fiddler help document for more information. <a href="http://www.fiddler2.com/Fiddler/help/">http://www.fiddler2.com/Fiddler/help/</a></span></p>]]></content:encoded>
    </item>
    <item>
      <title>Power of HTML5 Audio Tag – With IE9, Chrome, Safari, Wp7, iPhone, iPad</title>
      <link>https://docs.microsoft.com/archive/blogs/mingfeis_code_block/power-of-html5-audio-tag-with-ie9-chrome-safari-wp7-iphone-ipad</link>
      <pubDate>Thu, 26 May 2011 07:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Mingfei]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mingfeis_code_block/2011/05/26/power-of-html5-audio-tag-with-ie9-chrome-safari-wp7-iphone-ipad/</guid>
      <description><![CDATA[I tried HTML5 Audio Tag myself and simply amazed by how easy this can be implemented. Meanwhile,...]]></description>
      <content:encoded><![CDATA[<p>I tried HTML5 Audio Tag myself and simply amazed by how easy this can be implemented. Meanwhile, because it is native to the browser, it works fine on most of browsers (I tired FireFox, IE9, Safari and Chrome) and most of devices (Mango version of Windows Phone, iPhone and iPad). This is my toy site: <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/mbox.cloudapp.net">mbox.cloudapp.net</a>. I may not host it long hence I have printscreen for all the scnarios below, so you could see how Audio Tag rendered in different end devices.</p>
<p>Currently, HTML5 audio element has five attributes:</p>
<ul>
<li>autoplay: Specifies that the audio should start playing as soon as it is ready.</li>
<li>controls: Specifies that playback controls should be displayed.</li>
<li>loop: Specifies that the audio should start over again, when it is finished.</li>
<li>preload: Specifies whether or not the audio should be loaded when the page loads.</li>
<li>src: Specifies the URL of the audio to play.</li>
</ul>
<p>This is how to implement HTML5 video tag with one single line of code.</p>
<pre class="scroll"><code class="html"> &lt;audio id="player" src="YOUR_SOURCE_HERE" controls="controls" autoplay&gt;&lt;/audio&gt;</code></pre>
<p>And you can see the UI rendered like this in IE9. It shows a +30s and -30s when you mouse over the timer on both side. Also, current time and time for the whole song&nbsp;will be displayed as well. &nbsp;</p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot681-600x47.jpg"><img style="max-height: 300px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot681-600x47.jpg" /></a></p>
<p>Same Audio tag rendered like this in Chrome 11. It doesn&rsquo;t show much as IE9, such as overall timing and 30s fast-forward/fast-backward.
</p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot682-600x32.jpg"><img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot682-600x32.jpg" /></a></p>
<p>This is how Audio Tag looks like on Safari 5. There is no current time and total time. However, you can drop to next song/previous song.</p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot683-600x24.jpg"><img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot683-600x24.jpg" /></a></p>
<p>&nbsp;</p>
<p>I tired Opera 11 as well. It rendered in the browser but it doesn&rsquo;t play.Same thing happend to Firefox 4 Beta. Later on i found out it was because they don't support the audio format .Mp3.&nbsp;</p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot684-600x29.jpg"><img style="max-height: 100px; max-width: 550px;" border="0" src="http://innovativesingapore.com/wp-content/uploads/2011/05/ScreenShot684-600x29.jpg" /></a></p>
<p>I further tested Audio tag on iPhone 4.3 and iPad 4.3.3. It rendered as below. Moreover, when you minimize browser, music will still continue in the background. Double tab you could open the multi-task bar at the bottom of screen, swap right, you could see the native audio player control. I truly like this kind of native integration with HTML5 tag.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/7028.photo%20(3).PNG" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7028.photo-_2800_3_2900_.PNG"><img border="0" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/41/00/7028.photo%20(3).PNG" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x400/__key/communityserver-blogs-components-weblogfiles/00-00-01-41-00/7028.photo-_2800_3_2900_.PNG" /></a></p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-2.png"><img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-2.png" border="0" style="max-height: 300px; max-width: 550px;" /></a></p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-1-600x450.png"><img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-1-600x450.png" border="0" style="max-height: 300px; max-width: 550px;" /></a></p>
<p><a href="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-4-600x147.png"><img src="http://innovativesingapore.com/wp-content/uploads/2011/05/photo-4-600x147.png" border="0" style="max-height: 300px; max-width: 550px;" /></a></p>
<p>I tested Andiord phone as well, both 2.3 and 2.2 version. The Audio bar doesn&rsquo;t get loaded. Current Windows Phone 7 doesn&rsquo;t support Audio tag. However, since IE9 will be shipped with next version of Windows Phone 7, obviously, audio tag will be native to Windows Phone 7 browser in the near future as well.</p>
<p>I had a problem with starting a song with a specific timing, such as starting a song from 20 seconds (streaming). Because the song may not be loaded till that point, so if you jump to that point, it will have javascript error. Here is a way to solve it. And you can definitely improve it.</p>
<p>&nbsp;</p>
<pre class="scroll"><code class="html">&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type="text/javascript"&gt;<br />
    function timeMsg(startime) {<br />
        var t = setTimeout("a("+startime+")", 5000);<br />
    }<br />
<br />
    function a(startime) {<br />
        $("#player")[0].play();<br />
        $("#player")[0].currentTime = startime;<br />
    }<br />
    function song_onClick(item) {<br />
        var startTime = item.id;<br />
        var songSrc = item.title;<br />
        alert(songSrc + startTime);<br />
        $("#player")[0].pause();<br />
        $("#player")[0].src = songSrc;<br />
        $("#player")[0].load();<br />
        timeMsg(startTime);<br />
     }<br />
 &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
 &lt;audio id="player" src="YOUR_SOURCE_HERE" controls="controls" autoplay&gt;&lt;/audio&gt;<br />
    &lt;div class="song" title="YOUR_SOURCE_HERE" id="20" onclick="song_onClick(this)"&gt;<br />
        Maid with the Flaxen Hair<br />
    &lt;/div&gt;<br />
&lt;/body&gt;             <br />
&lt;/html&gt;</code></pre>
<p>&nbsp;</p>
<p>You can see from the code, the ID of the audio element is player.</p>
<p>$(&ldquo;#player&rdquo;)[0].src = songSrc; is used to change the song src. So that we can change to the next song.</p>
<p>However, here is&nbsp;the track. If you wanted to start a song from some random point, you have to load the song first (if the song is streamed). Hence, I used setTimeOut method here to delay playing the song for 5 sec and I started play the song from 20 seconds. However, still, if you start more than 20 seconds, 5 seconds may not be long enough. You could design it to times a multiplier.</p>
<p>Hope this post will inspire you to try out your audio application in HTML5, so you could benefit from one code base works for most of browsers and devices!</p>]]></content:encoded>
    </item>
  </channel>
</rss>