Sound in Script Done
Fom script user can load, play and stop sound
This commit is contained in:
parent
517c0e86cb
commit
f03f8076f3
16 changed files with 309 additions and 18 deletions
|
@ -5,10 +5,10 @@ var targetObjectTutoBubble ='Tutobubble';
|
|||
var targetObjectTutoChat ='tutoChat';
|
||||
var targetObjectTutoExplanation ='tutoExplanation';
|
||||
var popUpExplanation = undefined;
|
||||
var enterSoundUrl = "/resources/objects/webrtc-in.mp3";
|
||||
var exitSoundUrl = "/resources/objects/webrtc-out.mp3";
|
||||
var enterSoundUrl = "webrtc-in.mp3";
|
||||
var exitSoundUrl = "webrtc-out.mp3";
|
||||
var soundConfig = {
|
||||
volume : 0.5,
|
||||
volume : 0.2,
|
||||
loop : false
|
||||
}
|
||||
function launchTuto (){
|
||||
|
@ -32,6 +32,7 @@ function launchTuto (){
|
|||
className : "success",callback:(popup2 => {
|
||||
popup2.close();
|
||||
WA.restorePlayerControl();
|
||||
WA.loadSound(winSoundUrl).play(soundConfig);
|
||||
})
|
||||
}
|
||||
])
|
||||
|
@ -49,8 +50,7 @@ function launchTuto (){
|
|||
|
||||
WA.onEnterZone('popupZone', () => {
|
||||
WA.displayBubble();
|
||||
|
||||
WA.playSound(enterSoundUrl,soundConfig);
|
||||
WA.loadSound(enterSoundUrl).play(soundConfig);
|
||||
if (!isFirstTimeTuto) {
|
||||
isFirstTimeTuto = true;
|
||||
launchTuto();
|
||||
|
@ -79,6 +79,5 @@ WA.onEnterZone('popupZone', () => {
|
|||
WA.onLeaveZone('popupZone', () => {
|
||||
if (popUpExplanation !== undefined) popUpExplanation.close();
|
||||
WA.removeBubble();
|
||||
WA.playSound(exitSoundUrl,soundConfig);
|
||||
|
||||
WA.loadSound(exitSoundUrl).play(soundConfig);
|
||||
})
|
||||
|
|
BIN
maps/Tuto/webrtc-in.mp3
Normal file
BIN
maps/Tuto/webrtc-in.mp3
Normal file
Binary file not shown.
BIN
maps/Tuto/webrtc-out.mp3
Normal file
BIN
maps/Tuto/webrtc-out.mp3
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue