PageSourceSearch

https://leightonandrews.live/wp-content/plugins/mp3-audio-player/js/psap.js?ver=7.1.3

js leightonandrews.live collected 2026-10-10 00:57:51 UTC 2,815 bytes, 123 lines download raw bytes

1$=jQuery.noConflict();
2
3// inner variables
4var song;
5var tracker = $('.psap_tracker');
6var volume = $('.psap_volume');
7// initialization - first element in playlist
8initAudio($('.psap_playlist li:first-child'));
9// set volume
10song.volume = 0.8;
11// initialize the volume slider
12volume.slider({
13	range: 'min',
14	min: 1,
15	max: 100,
16	value: 80,
17	start: function(event,ui) {},
18	slide: function(event, ui) {
19		song.volume = ui.value / 100;
20	},
21	stop: function(event,ui) {},
22});
23// empty tracker slider
24tracker.slider({
25	range: 'min',
26	min: 0, 
27	max: 10,
28	start: function(event,ui) {},
29	slide: function(event, ui) {
30		song.currentTime = ui.value;
31	},
32	stop: function(event,ui) {}
33});
34
35function initAudio(elem) {
36	var url = elem.attr('audiourl');
37	var title = elem.text();
38	var cover = elem.attr('cover');
39	var artist = elem.attr('artist');
40	$('.psap_player .psap_title').text(title);
41	$('.psap_player .psap_artist').text(artist);
42	$('.psap_player .psap_cover').css('background-image','url(' + cover + ')');
43	song = new Audio(url);
44	// timeupdate event listener
45	song.addEventListener('timeupdate',function (){
46		var curtime = parseInt(song.currentTime, 10);
47		tracker.slider('value', curtime);
48	});
49	$('.psap_playlist li').removeClass('active');
50	elem.addClass('active');
51}
52
53function playAudio() {
54	song.play();
55	updateMaxSlider();
56	$('.psap_play').addClass('psap_hidden');
57	$('.psap_pause').addClass('psap_visible');
58	window.updateTimer = setInterval(updateMaxSlider, 2000);
59}
60
61function updateMaxSlider() {
62	if (song.duration == "Infinity")
63	{
64		tracker.slider("option", "max", 300);
65	}else{
66		tracker.slider("option", "max", song.duration);
67		clearInterval(window.updateTimer);
68	}		
69}
70
71function stopAudio() {
72	song.pause();
73	$('.psap_play').removeClass('psap_hidden');
74	$('.psap_pause').removeClass('psap_visible');
75}
76
77// play click
78$('.psap_play').click(function (e) {
79	e.preventDefault();
80	playAudio();
81});
82
83// pause click
84$('.psap_pause').click(function (e) {
85	e.preventDefault();
86	stopAudio();
87});
88
89// forward click
90$('.psap_fwd').click(function (e) {
91	e.preventDefault();
92	stopAudio();
93	var next = $('.psap_playlist li.active').next();
94	if (next.length == 0) {
95		next = $('.psap_playlist li:first-child');
96	}
97	initAudio(next);
98});
99
100// rewind click
101$('.psap_rew').click(function (e) {
102	e.preventDefault();
103	stopAudio();
104	var prev = $('.psap_playlist li.active').prev();
105	if (prev.length == 0) {
106		prev = $('.psap_playlist li:last-child');
107	}
108	initAudio(prev);
109});
110
111
112// show playlist
113$('.psap_pl').click(function (e) {
114	e.preventDefault();
115	$('.psap_playlist').fadeToggle(300);
116});
117
118// playlist elements - click
119$('.psap_playlist li').click(function () {
120	stopAudio();
121	initAudio($(this));
122});
123

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.