Здравствуйте. Есть код на jquery, как правильно сделать его на javascript без использования библиотеки?
$(document).ready(function() {
var e = $(".v24_video-widget"),
a = document.getElementById("v24_video-widget__video");
$(".v24_video-widget__close").click(function(t) {
return t.preventDefault(), "default" == e.attr("data-state") ? e.hide() : (e.attr("data-state", "default"), a.muted = !0), !1
}), $(".v24_video-widget__container").on("click", function(t) {
"default" == e.attr("data-state") ? (e.attr("data-state", "opened"), a.currentTime = 0, a.muted = !1) : (e.attr("data-state", "default"), a.muted = !0)
}), 1024 < $(document).width() && $(".v24_video-widget__container").on("touchstart", function(t) {
"default" == e.attr("data-state") ? (e.attr("data-state", "opened"), a.currentTime = 0, a.muted = !1) : (e.attr("data-state", "default"), a.muted = !0)
}), $(document).mouseup(function(t) {
e.is(t.target) || 0 !== e.has(t.target).length || "default" == e.attr("data-state") || (e.attr("data-state", "default"), a.muted = !0)
});
});