0

I have the following Javascript variable.

<script type ="text/javascript">
    document.getElementById("vid").src = video.url();
</script>

How do I put the videoUrl into my movie player.

<video width="320" height="240" controls autoplay>
<embed id="vid" src="videoUrl" width="200" height="200">
</video>
asdasdasd
  • 19
  • 5
  • possible duplicate of [JavaScript: Changing src-attribute of a embed-tag](http://stackoverflow.com/questions/2493706/javascript-changing-src-attribute-of-a-embed-tag) – celerno Mar 20 '14 at 18:42

1 Answers1

2

Get the element with javascript (after it is loaded into the DOM) then change its src attribute.

<embed id="vid" src="videoUrl" width="200" height="200">
<script type="text/javascript">
    document.getElementById("vid").src = video.url();
</script>
Logan Murphy
  • 6,120
  • 3
  • 24
  • 42