0

I need to add an audio (mp3) file in the modern SharePoint site. I found information that I can do that by using embed code:

<iframe src="pathtomyaudiofile.mp3" width="100%" height="100"></iframe >

However, when I add it, the audio starts playing automatically each time when I open the SP site.

Is there an option to add paused audio, so anyone who wishes to listen to it will have to click 'play'?

1 Answer 1

0

I've done some testing and audio in an iframe or a video-element doesn't seem to autoplay for me.

You could though, try to replace your iframe with a video-element:

<video width="100" height="100" controls muted>
  <source src="pathtomyaudiofile.mp3" type="audio/mp3" />
</video>

OR using an audio-element

<audio src="pathtomyaudiofile.mp3" controls muted />

This should not autoplay and if it does, it will be muted.

2
  • Thank you @DmitriyVdE Could you advise how should I add a video or audio element? When I try to add them I get an error message saying that embed code must be iframe-based.
    – Julia
    Commented Mar 17, 2022 at 10:46
  • @Julia You could try to put either option inside of an <iframe></iframe>-element.
    – DmitriyVdE
    Commented Mar 17, 2022 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.