0

I would like to enter a url in a text box and be able to mirror that url to the video html. Example url: http://www.example.com/video.mp4

I am thinking this should be possible using js. This is how the html would originally look like

<input type="text" value="" />
<video width="320" height="240">
    <source type="video/mp4" src=""/>
</video>

After entering the url the html would look like this.

<input type="text" value="http://www.example.com/video.mp4" />
<video width="320" height="240">
    <source type="video/mp4" src="http://www.example.com/video.mp4"/>
</video>

I would then extend this to support all three video formats with three text fields.

Joe
  • 14,083
  • 8
  • 46
  • 56
grappler
  • 367
  • 4
  • 15
  • Possible duplicate of [changing source on html5 video tag](http://stackoverflow.com/questions/5235145/changing-source-on-html5-video-tag) – Joe Jun 15 '13 at 13:57
  • 1
    http://jsfiddle.net/Me7UB/1/ – askovpen Jun 15 '13 at 14:08
  • @askovpen Your solution works great. I changed it a bit so the go button was not needed. http://jsfiddle.net/Me7UB/4/ Please answer the question and I will select yours as the best answer. – grappler Jun 15 '13 at 14:56

0 Answers0