<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container">
<div class="card mt-4">
<div class="card-header">HTML5 Audio Player Example</div>
<div class="card-body">
<audio controls>
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
type="audio/mpeg"
/>
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.ogg"
type="audio/ogg"
/>
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.wav"
type="audio/wav"
/>
Audio not supported
</audio>
</div>
</div>
</div>
</body>
</html>
簡單,只需嘗試在& lt音頻& gt標簽。
<audio controls class="w-100"></audio>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container">
<div class="card mt-4">
<div class="card-header">HTML5 Audio Player Example</div>
<div class="card-body">
<audio controls class="w-100">
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
type="audio/mpeg"
/>
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.ogg"
type="audio/ogg"
/>
<source
src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.wav"
type="audio/wav"
/>
Audio not supported
</audio>
</div>
</div>
</div>
</body>
</html>