最近研究videojs,整理下一些参数
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Video.js</title> 6 <link href="css/video-js.css" rel="stylesheet"> 7 <!-- support IE8 --> 8 <script src="js/videojs-ie8.min.js"></script> 9 </head> 10 <body> 11 <video id="myvd" class="video-js"> 12 <p class="vjs-no-js">需要js</p> 13 </video> 14 <a onclick="byevd()">删除</a> 15 <script src="js/video.js"></script> 16 <script> 17 var vd = videojs('myvd',{ 18 width:1000,//宽string|number 19 height:450,//高:string|number 20 controls:true,//控制条:boolean 21 preload:"none",//预加载:string;'auto'|'true'|'metadata'|'none' 22 poster:'source/suoluetu.jpg',//预览图:string 23 autoplay:false,//自动播放:boolean 24 loop:true,//循环:boolean 25 muted:true,//静音:boolean 26 sources:[ 27 { 28 src:'source/test.mp4', 29 type:'video/mp4' 30 } 31 ], 32 controlBar: { 33 muteToggle: false, 34 volumeMenuButton:false//静音按钮 35 } 36 },function onPlayerReady(){ 37 var vdthis = this; 38 videojs.log('ok'); 39 this.on('ended',function(){ 40 videojs.log('ended') 41 }) 42 this.on('timeupdate',function (e){ 43 //videojs.log(vdthis.currentTime()) 44 }) 45 }); 46 //删除 47 function byevd(){ 48 vd.dispose(); 49 } 50 51 </script> 52 </body> 53 </html>
待完善。。。