Audio onEnd jump to page

Was trying to get my Audio player to send an event at the end of playback that makes it jump to another page but is not working … can someone tell me whats wrong here? Thanks

import wixLocation from ‘wix-location’ ;

$w . onReady ( function () {
$w ( “#audioPlayer1” ). onEnded ( ( event ) => {
wixLocation . to ( “/About” );
});
});

Try to inspect your code by your own. How?
For example you can check, if the issue is your —> LOCATION-TO-PART in your code.

Take a working site-url → for example —> https://www.google.com and replace it with yours.
wixLocation . to ( " https://www.google.com " );

Now take a look at the function of your code. Does it now work with the new URL ?

If → YES —> You found your problematic code-part.
If → NOT → Continue searching using CONSOLE-LOG.

Your code consists of just 5-codelines. I am sure you will be able to solve your issue by your own.

Thanks Ninja will troubleshoot it , just wanted to make sure I wasn’t missing some other thing that I don’t know about, is all new to me doing this. Thanks again for your help.

@chrismeredith Here you will find everything about → wix-location…
https://www.wix.com/velo/reference/wix-location

And here …
https://www.wix.com/velo/reference/$w/audioplayer

…everything about Audio-Player.