title: Object to canvas javascript
body: <p>I'm testing javascript on a smart TV,</p>
  <p>I try to get an object video to canvas. With html5 video tag it works in my browser, but not my smart TV.</p>
  <p>But when I try with an object player, I have this error message :</p>
  <blockquote>
  <p>Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The
  provided value is not of type '(HTMLImageElement or HTMLVideoElement
  or HTMLCanvasElement or ImageBitmap)'</p>
  </blockquote>
  <p>after multiple test with (id, object id,object src..) the result is same, i don't know how i can get an Object video to a canvas.</p>
  <p>here's a simple html test:</p>
  <pre><code>&lt;canvas id=&quot;test&quot; width=&quot;300&quot; height=&quot;300&quot;&gt;&lt;/canvas&gt;
  &lt;div id=&quot;test&quot; style=&quot;left: 0%; top: 0%; width: 25%; height: 25%; position: fixed;&quot;&gt;
      &lt;object type=&quot;application/avplayer&quot; style=&quot;width: 480px; height: 270px;&quot;&gt;&lt;/object&gt;
  &lt;/div&gt;
  </code></pre>
  <p>and the js:</p>
  <pre><code>const canvas = document.querySelector(&quot;canvas&quot;);
  const ctx = canvas.getContext(&quot;2d&quot;);
  const video = document.getElementsByTagName('object');
  //const video = document.getElementsById('idVideo');
  ctx.drawImage(video, 0, 0, canvas.width, canvas.height)
  </code></pre>
  <p>Here's an example of my goal but i can't use video tag : <a href="http://jsfiddle.net/on1kh4o0/" rel="nofollow noreferrer">http://jsfiddle.net/on1kh4o0/</a></p>
  <p>Any idea or hack to get the same result with an object?</p>