1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add theme song

This commit is contained in:
Luke Pulverenti 2015-10-14 13:52:49 -04:00
parent 86e7b20cfc
commit 1fbb32df8c
11 changed files with 1662 additions and 4 deletions

View file

@ -2,6 +2,7 @@
Dashboard.importCss('themes/halloween/style.css');
var lastSound = 0;
function onPageShow() {
var page = this;
@ -9,6 +10,12 @@
if (!$.browser.mobile && !page.classList.contains('itemDetailPage')) {
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
}
if (lastSound == 0) {
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparade.mp3', .2);
} else if ((new Date().getTime() - lastSound) > 30000) {
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
}
}
pageClassOn('pageshow', "libraryPage", onPageShow);
@ -17,4 +24,18 @@
onPageShow.call($($.mobile.activePage)[0]);
}
function playSound(path, volume) {
require(['howler'], function (howler) {
var sound = new Howl({
urls: [path],
volume: volume || .3
});
sound.play();
lastSound = new Date().getTime();
});
}
})();