Skip to Content
0

How to play audio in SAP UI5 ??

Jan 03 at 04:17 AM

66

avatar image

Hello All,

I need to play an audio in SAP UI5 , I tried using below method but it is showing error "DOMException: Failed to load because no supported source was found."

var audio =newAudio('audio_file.mp3');
audio.play();
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Richard Zhao
Jan 03 at 06:49 AM
1

Hello, Rewati. This issue is because of your .mp3 file could not be found. There must be something wrong with your file path. I can play mp3 by using this path on my local machine. Check your path, please. The path you are using means rootpath/audio_file.mp3.Is that correct?

var audio = new Audio("mockdata/001_A.mp3");
audio.play();
Share
10 |10000 characters needed characters left characters exceeded