/    Sign up×
Community /Pin to ProfileBookmark

reload after mp3 file stop

hi,

script :

to play [I]N [/I] mp3 files , start from minute = 15

but, i try to make auto reload : window.location.reload() after end of each file

[CODE]<script type=text/javascript>

function hh () {

var File = [“audio-00.mp3″,”audio-01.mp3″,”audio-02.mp3″,”audio-03.mp3″,”audio-04.mp3”];

var audiolngth = [10,5,15,3,7]; // length of mp3 files in minutes.

var strtmin=15; // start minute, start playing mp3 files from 15th minute hr:15

var audioend = [21,31,46,49,57]; // end minute, stop playing mp3 files

var nF = 5; // number of files

var d=new Date();

// minutes now (d.getMinutes()) greater than end minute of 1st file (audioend[0]) and minute now (d.getMinutes())less than end minute of last file plus 1 (audioend[nF]+1)

if (d.getMinutes() >= strtmin && d.getMinutes() < (audioend[nF]+1)) {

if (d.getMinutes() == strtmin && d.getMinutes() <= audioend[0]) {

var endmin=audioend[0];

document.write(“<embed src=File[0] autostart=true>”);

}

if (d.getMinutes() > strtmin && d.getMinutes() <= (strtmin+audioend[nF])) {

for (i=1,i<nF+1,i++) {

var endmin=audioend[i];

// minutes now (d.getMinutes()) greater than end minute of prev. file (audioend[i-1]) and minute now (d.getMinutes())less than or equal to end minute of current file(audioend[i])

if (d.getMinutes() == audioend[i-1] && d.getMinutes() <= audioend[i]) {

document.write(“<embed src=File[i] autostart=true>”);

}

}

}

if (d.getMinutes() == endmin) {

window.location.reload(true);

}

} // if …

} // function ….

hh();

setInterval(“hh();”,60000) // do if (d.getMinutes() == endmin) { window.location.reload(true);} every minute

</script>[/CODE]

now its reload after 1minue from page loads .

[B]how to make it reload after end of each mp3 files when (d.getMinutes() == endmin) ?[/B]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @green_js spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...