play intro song after scene load to prevent choppy
This commit is contained in:
9
src/components/intro-song.js
Normal file
9
src/components/intro-song.js
Normal file
@@ -0,0 +1,9 @@
|
||||
AFRAME.registerComponent('intro-song', {
|
||||
multiple: true,
|
||||
|
||||
play: function () {
|
||||
const audio = document.getElementById('introSong');
|
||||
audio.volume = 0.5;
|
||||
audio.play();
|
||||
}
|
||||
});
|
||||
@@ -6,6 +6,9 @@
|
||||
<script src="build/build.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<audio id="introSong" src="assets/sounds/introSong.ogg" loop></audio>
|
||||
<script>document.getElementById('introSong').volume = 0.5;</script>
|
||||
|
||||
<a-scene
|
||||
bind__beat-loader="challengeId: challenge.id; difficulty: challenge.difficulty"
|
||||
bind__song="challengeId: challenge.id; isPlaying: !menu.active && !challenge.isLoading"
|
||||
@@ -14,6 +17,7 @@
|
||||
console-shortcuts
|
||||
debug-controller
|
||||
effect-bloom="strength: 1"
|
||||
intro-song
|
||||
proxy-event="event: menuchallengeselect; to: #searchResultsContainer, #menuDifficultiesGroup"
|
||||
overlay="objects: #menu, #keyboard, #rightHand, #leftHand"
|
||||
search
|
||||
@@ -47,8 +51,6 @@
|
||||
<a-mixin id="textFont" text="font: assets/fonts/Teko-Bold.json; shader: msdf; letterSpacing: 1"></a-mixin>
|
||||
</a-assets>
|
||||
|
||||
<audio id="introSong" src="assets/sounds/introSong.ogg" autoplay loop></audio>
|
||||
|
||||
<a-entity id="container">
|
||||
{% include './templates/stage.html' %}
|
||||
{% include './templates/gameUi.html' %}
|
||||
|
||||
Reference in New Issue
Block a user