My solution: http://jsfiddle.net/g7mrs/22/
function loadVideo(event) {
videojs("myPlayer").src({
type: "video/youtube",
src: "https://youtu.be/ZSn3Tvc7jQU"
});
event.preventDefault();
}
I got a working solution, however I would like to have only 1 function instead of 4
Any ideas?
data-srcattribute on button, and get it with:event.target.dataset.src