fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <video id="myVideo1" width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> 您的浏览器不支持 video 标签。 </video> <video id="myVideo2" width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> 您的浏览器不支持 video 标签。 </video><br> <button onclick="setMedGroup()" type="button">为两段视频设置媒体组合</button> <button onclick="getMedGroup()" type="button">获取两段视频的媒体组合</button> <script> var x = document.getElementById("myVideo1"); var y = document.getElementById("myVideo2"); function setMedGroup(){ x.mediaGroup = "test"; y.mediaGroup = "test"; } function getMedGroup(){ alert("视频 1 媒体组合: " + x.mediaGroup + ". 视频 2 媒体组合: " + y.mediaGroup); } </script> </body> </html>
运行结果