-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
69 lines (65 loc) · 2.6 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
$(document).ready(function () {
setInterval(function () {
$("#ifrm").remove();
}, 200);
setTimeout(function () {
$("script").last().remove();
$("head script").last().remove();
}, 500);
$('audio, video').mediaelementplayer();
$(".mejs__button button").on("click", function () {
if ($('.mejs__controls').children().hasClass("mejs__play")) {
$(".player-rotate__container").addClass("rotating");
} else {
$(".player-rotate__container").removeClass("rotating");
}
});
$(".btn-play").on("click", function () {
var changeImg = $(this).attr('data-src');
var dataId = $(this).attr('data-id');
var title = $(this).parent().parent().children(".playlist-title .card__links");
$(".icon-play").addClass("active");
// $(".icon-pause").addClass("active");
if ($(".playlist-item").hasClass('active')) {
$(".playlist-item").removeClass('active');
$(".icon-pause").removeClass("active");
$(".icon-play").addClass("active");
$(this).children().children(".icon-play").removeClass("active");
$(this).children().children(".icon-pause").addClass("active");
$(this).parent().parent().parent().addClass('active');
} else {
$(this).parent().parent().parent().addClass('active');
$(this).children().children(".icon-play").removeClass("active");
$(this).children().children(".icon-pause").addClass("active");
}
$(".img-mask img").attr("src", changeImg);
$("#player2 audio").attr("src", "https://www.youtube.com/watch?v=" + dataId);
$("#player2 audio source").attr("src", "https://www.youtube.com/watch?v=" + dataId);
$(".player-rotate__container").addClass("rotating");
$('video, audio').each(function () {
$(this)[0].player.pause();
$(this)[0].player.setSrc("https://www.youtube.com/watch?v=" + dataId);
$(this)[0].player.play();
});
});
$('#playBtn').click(function () {
$('audio')[0].player.play();
$(".player-rotate__container").addClass("rotating");
});
$("#downloadBtn").click(function () {
$('html, body').animate({
scrollTop: $("#dlContent").offset().top - 200
}, 1000);
});
});
$(function () {
$('.lazy').lazy({
scrollDirection: 'vertical',
effect: 'fadeIn',
effectTime: 200,
visibleOnly: true,
onError: function (element) {
console.log('error loading ' + element.data('src'));
}
});
});