start/stop이 이미지 슬라이드쇼도 함께 제어하도록 수정한다.
기존에는 음악 음소거만 바뀌어 롤링이 멈추지 않던 문제를 고친다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -246,18 +246,36 @@ function onLoad() {
|
|||||||
|
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
if (!document.getElementById('betoven').muted) {
|
var audio = document.getElementById('betoven');
|
||||||
document.getElementById('betoven').muted = true;
|
var gallery = window.dreamgirlGallery;
|
||||||
|
var isRunning = gallery
|
||||||
|
? !!gallery.isSlideshowRunning
|
||||||
|
: !!(audio && !audio.muted);
|
||||||
|
|
||||||
|
if (isRunning) {
|
||||||
|
if (audio) {
|
||||||
|
audio.muted = true;
|
||||||
|
try { audio.pause(); } catch (e) {}
|
||||||
|
}
|
||||||
|
if (gallery && typeof gallery.pause === 'function') {
|
||||||
|
gallery.pause();
|
||||||
|
}
|
||||||
clearInterval(refreshIntervalId);
|
clearInterval(refreshIntervalId);
|
||||||
|
refreshIntervalId = null;
|
||||||
$("#toggle").html("start");
|
$("#toggle").html("start");
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('betoven').muted = false;
|
if (audio) {
|
||||||
/*
|
audio.muted = false;
|
||||||
refreshIntervalId = setInterval(function() {
|
try {
|
||||||
var index = Math.floor(Math.random()*278) + 1;
|
var playPromise = audio.play();
|
||||||
$("#thumbs").html("<img src='"+pictures[index]+"' width='100%' onerror=\"this.src='"+imgurl+"z7jP92.jpg'\"/>");
|
if (playPromise && typeof playPromise.catch === 'function') {
|
||||||
}, 3000);
|
playPromise.catch(function () {});
|
||||||
*/
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
if (gallery && typeof gallery.play === 'function') {
|
||||||
|
gallery.play();
|
||||||
|
}
|
||||||
$("#toggle").html("stop");
|
$("#toggle").html("stop");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user