clappr 是用于Web的可扩展的媒体播放器,跨平台,支持HLS,MP4等格式。
格式支持:
使用:
添加以下的脚本到你的 HTML:
<head> <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/latest/underscore.js"> </script> <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/latest/jquery.js"> </script> <script type="text/javascript" charset="utf-8" src="http://cdn.clappr.io/latest/clappr.min.js"> </script> </head>
创建播放器:
<body> <div id="player"></div> <script> var playerEl = document.getElementById("player"); var player = new Clappr.Player({source: "http://your.video/here.mp4"}); player.attachTo(playerEl); </script> </body>