سؤال

<audio controls>
    <source src="/audio/{$link_data.ID}.mp3" type="audio/mpeg">
    Your browser does not support the audio element.
</audio>

I have a mix of text like pages in a book, images and audio on my website. When you move from page to page a new mp3 is being loaded and sometimes images.

Sometimes people only read the text or play the audio or a mix of the two.

I was wondering what the best way is to have the audio available without it downloading (on each new page). By being available I mean that you would press the play button before it started to stream the audio.

هل كانت مفيدة؟

المحلول

Just set preload="none".

<audio controls preload="none">

The media will not begin downloading until requested by the user.

Reference:

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top