HTML5オーディオタグをマスターする

インターネットへの適度な高速接続の出現により、FlashはWebサイトでサウンドを再生するための唯一のツールでした。 ただし、HTML5は、インターネットでのサウンドの再生方法を根本的に変更します。 この記事では、サイトでタグを使用する方法について詳しく説明します。






<audio>を使用して、サウンドファイルをページに挿入します

以下は、タグを使用する最も簡単な例で, mp3 . autopaly , . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .




















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>



? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .




















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>



, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .




















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>



, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .




















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















 ,   mp3    .     autopaly
      
      



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .
















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .

















, mp3 . autopaly



, . , . <audio src="sound.mp3" autoplay></audio>







? loop . , , , . <audio src="sound.mp3" autoplay loop></audio>







, , , , , , (). , controls



. <audio src="sound.mp3" controls></audio>







, , . Safari, , MP3, Firefox , OGG- . , , , . <audio controls> <source src="sound.ogg"> <source src="sound.mp3"> </audio>







MIME- , MIME- , . type



. <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > </audio>







, IE6 - , ? : , , . <audio controls> <source src="sound.ogg" type="audio/ogg" > <source src="sound.mp3" type="audio/mp3" > audio! </audio>







. preload



. 3 : none - ; auto - , ; metadata - ( .).



JavaScript HTML5 - JavaScript . , JavaScript -: <audio id="player" src="sound.mp3"></audio> <div> <button onclick="document.getElementById('player').play()"></button> <button onclick="document.getElementById('player').pause()"></button> <button onclick="document.getElementById('player').volume+=0.1"> +</button> <button onclick="document.getElementById('player').volume-=0.1"> -</button> </div>







.

, HTML5 .



















All Articles