This might be a simple question, but I got confused here.
var videoSrc = "video/sample.mp4";
$('.abc').append('<video width="650" height="300" controls="controls"> <source src= "'
+ videoSrc
+ 'type="video/mp4" id="myVideo"/>Your browser does not support the video tag.</video>'
);
});
I am trying to insert the value of the variable videoSrc in the src attribute. It does not work like this.
The following code works fine:
$('.abc').append('<video width="650" height="300" controls="controls"> <source src="videos/sample2.mp4" '
+'type="video/mp4" id="myVideo"/>Your browser does not support the video tag.</video>'
);
But I have to insert the value of src attribute dynamically.
Help me to fix this.
Thanks