Is it possible somehow in jQuery to hide specific video or source element?
<video id="one" autoplay width="300px" height="300px">
<source src="media/sample3.mp4" type="video/mp4" />
</video>
<video id="two" autoplay width="300px" height="300px">
<source src="media/sample.mp4" />
</video>
I would like to play sample3, for example, for 1 minute, then pause sample3, hide it, show sample.mp4 and play that video.
Any suggestons?
My code which I tryed:
var video = $('video').get(0).pause();
if ($('video').get(0).paused) {
$('video').get(0).hide();
};
but the $('video').get(0).hide(); throws Uncaught TypeError: Object #<HTMLVideoElement> has no method 'hide'
setInterval()could helpget(0)de-referenced your jQuery object, so that you have the “native” DOM object. While that has apausedproperty that you are checking for here (although you could do that with jQuery’spropas well), it has nohidemethod – that is a jQuery method, not a method of native DOM elements. So in the 3rd line, you have to access the jQuery object directly, not the DOM element.