标签:style blog http color io os ar java strong
效果图:
<html> <head> <title>JwPlayer播放器@杯中红茶</title> <script type="text/JavaScript" src="jwplayer.js"></script> </head> <body> <div id="container">Loading...</div> <script type="text/JavaScript"> var add var files plays() function check(){ add=document.getElementById("add").value files=document.getElementById("files").value if(add==""){ alert("请输入RTMP服务地址") } if(files==""){ alert("请输入视频名称") } if(add !="" && files !=""){ plays() jwplayer().play() } } function plays(){ jwplayer("container").setup({ flashplayer:"player.swf", provider:"rtmp", streamer:add, file:files, <!--file:add, rtmp://czr2014.xicp.net:1937/WebFiles /1/LearnKJ/002.mp4--> height:400, width:610, <!--duration:10,--> volume:10, autostart:false, <!--controlbar:false,--> <!--repeat:"always",--> controlbar:"bottom", events: { onComplete: function() { alert("the video is finished!"); } } }); } </script> <p> RTMP地址:<input type="text" id="add" name="add" style="width:530px"/><br /> 视频名称:<input type="text" id="files" name="files" style="width:530px"/> </p> <p> <button onclick=‘check()‘>载入</button>| <button onclick=‘jwplayer().play()‘>播放</button>| <button onclick=‘jwplayer().pause()‘>暂停</button>| <button onclick=‘jwplayer().stop()‘>停止</button>| <button onclick=‘jwplayer().seek(60)‘>跳到60秒</button>| <button onclick=‘alert(jwplayer().getPosition())‘>获取当前时间</button>| <button onclick=‘alert(jwplayer().getDuration())‘>获取视频总时</button> </p> </body> </html>
相关文件下载:
jwplayer下载
标签:style blog http color io os ar java strong
原文地址:http://www.cnblogs.com/czrwxw/p/4024475.html