title: How to play gif inside canvas in HTML5
body: <p>I want to play animated GIF file inside a HTML Canvas. I have used the code below but it is not working.</p>
  <p>What is wrong with the code?</p>
  <pre><code>var drawingCanvas = document.getElementById('myDrawingCanvas');
  if(drawingCanvas.getContext) 
  {
      var context = drawingCanvas.getContext('2d');
      var imgObj = new Image();
  
      imgObj.onload = function () 
      {       
          context.drawImage(imgObj, 0, 0, 1024, 600);
      }
      imgObj.src='HTML Images/Spell Bee/images/mainscreen.gif';
  }
  </code></pre>