title: Playing a video file from a sql server blob via ashx handler using HTML5 Video Tag
body: <p>I am using code from this <a href="http://www.codeproject.com/Articles/21480/Video-Uploader-Control-for-SQL-Server" rel="nofollow">codeproject article</a> to upload a MP4 video file to SQL server(varbinary(MAX)) and play it back from there.</p>
  
  <p>My requirement is to use SQL server specifically instead of storing and fetching videos from the file system.</p>
  
  <p>This is the code I am using to play the video:</p>
  
  <pre><code>&lt;video id='my_video_1'  controls
     width="640" height="264"
    data-setup="{"controls":true, "preload":none}" &gt;
    &lt;source src='&lt;%# "VideoHandler.ashx?id=" + Eval("ID") %&gt;' type='video/mp4'&gt;  
  &lt;/video&gt;
  </code></pre>
  
  <p>If I use a physical video file as the video source, it works. However the above code does not work.</p>
  
  <p>In "Internet Explorer" the tag renders a black box with a red cross</p>
  
  <p>In "Chrome" the player buttons are visible but when I click play button, no video is played. When we right click it shows "Save Video as..." option and the downloaded file runs fine with a desktop media player.</p>
  
  <p>Please help me with correct code.</p>