I have this code:
It is being called in and onchange event handler for a select/opt element.
The selection list is for a group of short mp3 files of chimes.
The setLength function gets a time stamp at the start
and a time stamp at the end and subtracts start time from end time
to get the duration of the chime. This will be used in a timer cycle that
has a beginning chime and an end chime.
This works fine in Firefox and Chrome.
In Safari this is the error I get:
(Safari Version 13.1.2 (13609.3.5.1.5))
Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent
or the platform in the current context, possibly because the user denied permission.
Does anyone here have any idea why Safari is choking on this?
I have set up a demo at:
www.jekillen.com/lab_63
Thank you for time and attention
JEK
Code:
let sampleChime = function(a) { /* a: obect;{'selection':string; mp3 file} */ target = a.id; chime = new Audio(); chime.src = 'chimes/'+a.selection; chime.addEventListener('error', audioHandler, false); chime.load(); chime.addEventListener("canplaythrough", e => { setLength(e, 'start');}); chime.addEventListener("loadeddata", e => { chime.play();}); chime.addEventListener("ended", e => { setLength(e, 'end')}); }
The selection list is for a group of short mp3 files of chimes.
The setLength function gets a time stamp at the start
and a time stamp at the end and subtracts start time from end time
to get the duration of the chime. This will be used in a timer cycle that
has a beginning chime and an end chime.
This works fine in Firefox and Chrome.
In Safari this is the error I get:
(Safari Version 13.1.2 (13609.3.5.1.5))
Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent
or the platform in the current context, possibly because the user denied permission.
Does anyone here have any idea why Safari is choking on this?
I have set up a demo at:
www.jekillen.com/lab_63
Thank you for time and attention
JEK
Comment