0

I'm trying to make a web player and it is supposed to change the video source by the click of a button, but it does not work, I've tried everything.

myVideo.src = "http://www8.cs.umu.se/kursmaterial/html5/mediafiler/WaterBalloon2.mp4";

This part is supposed to have 2 video sources, 1 for mp4 and 1 for ogv, which I can't seem to figure out how to do.

http://jsfiddle.net/Pqb3H/

Thanks!

Davy Karlsson
  • 587
  • 2
  • 6
  • 12
  • possible duplicate of [changing source on html5 video tag](http://stackoverflow.com/questions/5235145/changing-source-on-html5-video-tag) – rorypicko Dec 04 '13 at 16:03

1 Answers1

0

You should add var myVideo=document.getElementById("video1")[0]; inside the getVideo() function,

Fiddle: http://jsfiddle.net/Pqb3H/1/

Krish R
  • 21,556
  • 6
  • 47
  • 57