The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Managing multiple audios
berrymoon
post Feb 9 2018, 11:56 AM
Post #1





Group: Members
Posts: 2
Joined: 9-February 18
Member No.: 26,586



Hi there I'm struggling many many hours before daring to post.

What I need to do is to manage the audios on a page. Basically (in my simple example) I have a background sound, and a map on which there is an area supposed to launch another audio using onclick. At the end of this audio, the background one should resume.
Attached is my minimalist script and will appreciate if someone outhere can give it a look.

Many thanks in advance.
M



Attached File(s)
Attached File  P_mini.html ( 3.1k ) Number of downloads: 80
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 9 2018, 03:28 PM
Post #2


This is My Life
*******

Group: Members
Posts: 1,491
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



I admit I don't do much with audio files but looking over your code I don't see where 'audio_background' is defined. The script halts at that line of code.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
berrymoon
post Feb 9 2018, 03:39 PM
Post #3





Group: Members
Posts: 2
Joined: 9-February 18
Member No.: 26,586



QUOTE(CharlesEF @ Feb 9 2018, 03:28 PM) *

I admit I don't do much with audio files but looking over your code I don't see where 'audio_background' is defined. The script halts at that line of code.

Thanks CharlesEF for your reply.
I've downloaded the file to check and actually it has 103 lines.

The definition of audio_background is set at t line 59
i.e.

<script> let audio_backgroundaudio= document.getElementById("backgroundaudio"); </script>

Hope it helps and thx again.

BTW the background audio works perfectly. However when I click on the area (<area shape="circle" coords="600,425,30" onclick="playMusique(audio_main);" style="cursor: pointer;">) nothing happens the audio_main doesn't look as recognized for some reasons.

This post has been edited by berrymoon: Feb 9 2018, 03:43 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 9 2018, 04:04 PM
Post #4


This is My Life
*******

Group: Members
Posts: 1,491
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Those are not the same variables. 1 = 'audio_background' while 2 = 'audio_backgroundaudio'.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th June 2018 - 11:38 AM