Tôi muốn phát/tạm dừng video bằng jquery.Phát/Tạm dừng video HTML5 bằng cách sử dụng Jquery
Đây là mã của tôi:
(function ($) {
// plugin definition
$.fn.htmlvideo = function (options) {
// build main options before element iteration
var defaults = {
theme: 'normal',
};
var options = $.extend(defaults, options);
// iterate and reformat each matched element
return this.each(function() {
var $htmlvideo = $(this);
addvideo();
addcontrols();
function addvideo() {
var addvideo = $('<video width="1000"><source src="http://devfiles.myopera.com/articles/2642/sintel-trailer.ogv" type="video/ogg; codecs="theora, vorbis""><source src="http://devfiles.myopera.com/articles/2642/sintel-trailer.mp4" type="video/mp4; codecs="avc1.42E01E, mp4a.40.2""></video>');
$(addvideo).appendTo('#video');
}
function addcontrols() {
var controls = $('<div id="controls" class="controls"><button id="playbtn" class="playbtn"></button></div>');
$(controls).appendTo('#controlspane');
}
$('.playbtn').click(function() {
//Here I need to make the video play
});
});
};
})(jQuery);
@ 3nigma-Cảm ơn một lần nữa để phân loại cho tôi những vấn đề. – coder
vui vì đã giúp, từ câu hỏi trước tôi nhận thấy rằng bạn đang sử dụng nhiều id trong neo và trong điều khiển video, đó là sai id nên là duy nhất ... – Rafay
Chắc chắn, tôi sẽ không làm điều đó một lần nữa. chỉ ra. – coder