1. 程式人生 > >Html-音視訊基礎例項

Html-音視訊基礎例項

音訊:


<!DOCTYPE html>
<html>
<body>

<h4>使用embed</h4>
<embed height="50" width="100" src="horse.mp3">

<h4>使用object</h4>
<object height="50" width="100" data="horse.mp3"></object>

<h4>使用audio</h4>
<audio controls>
  <source src="horse.mp3" type="audio/mpeg">
  <source src="horse.ogg" type="audio/ogg">
</audio><br/>

<audio controls>
	<source src="horse.mps" type="audio/mpeg">
	<source src="horse.ogg" type="audio/ogg">
	 <embed height="50" width="100" src="horse.mp3">
</audio>

<h4>雅虎播放器</h4>
<p><a href="horse.mp3">Play mp3</a></p>
<p><a href="liar.wav">Play  wav</a></p>

<script src="http://mediaplayer.yahoo.com/latest"></script>
<br/>

<h4>使用超連結</h4>

<p><a href="horse.mp3">點選播放</a></p>

</body>
</html>

視訊:

<!DOCTYPE html>
<html>
<body>

<h4>點選播放(video)</h4>
<video width="320" height="240" controls>
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.webm" type="video/webm">
</video>

<h4>使用video(object)</h4>
<video width="320" height="240" controls>
  <source src="movie.ogg" type="video/ogg">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.webm" type="video/webm">
  <object data="movie.mp4" width="320" height="240">
    <embed width="320" height="240" src="movie.swf">
  </object>
</video>

<h4>使用超連結</h4>
<a href="movie.ogg">點選播放</a>

</body>
</html>