4.4 JS形式调用

 

JS形式调用范例:

 

例(4.4)-1:js写法示例

<!--代码开始-->
<script type="text/javascript" src="/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer">
<SCRIPT LANGUAGE=JavaScript>
<!--
/**
* 极酷阳光播放器V3.5视频播放参数
* @param {Object} width 视频宽度
* @param {Object} height 视频高度
* @param {Object} imgUrl 图片地址
* @param {Object} videoUrl 视频文件地址
* @param {Object} divID 显示的divID
*/
function setVideo(width, height, imgUrl, videoUrl, divID){
var so = new SWFObject("/player/player.swf","CuSunPlayer",width, height, "9", "#000000");
so.addParam("allowfullscreen","true");
so.addParam("allowscriptaccess","always");
so.addParam("wmode","opaque");
so.addParam("quality","high");
so.addParam("salign","lt");
so.addVariable("JcScpFile","/player/CuSunV3Set.xml");
so.addVariable("JcScpVideoPath",videoUrl);
so.addVariable("JcScpImg",imgUrl);
so.write(divID);
}
setVideo(600,400,"/player/startpic.jpg","http://demo.cuplayer.com/file/test.mp4","CuPlayer");
//-->
</SCRIPT>
</div>
<!--代码结束-->

 

例(4.4)-2:Ebemb调用示例2

<script type="text/javascript">
<!--
var vWidth = 600;
var vHeight = 410;
var vPlayer = "/player/player.swf";
var vSet = "/player/CuSunV3Set.xml";
var imgUrl = "/player/images/start.jpg";
var videoUrl = "http://demo.cuplayer.com/file/est.mp4";
var flashvars = "JcScpFile="+vSet+"&JcScpImg=" +imgUrl+"&JcScpVideoPath="+videoUrl+"";
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\""+ vWidth +"\" height=\""+ vHeight +"\" >");
document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"movie\" value=\""+vPlayer+"\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#000000\">");
document.write("<param name=\"menu\" value=\"false\"><param name=wmode value=\"opaque\">");
document.write("<param name=\"FlashVars\" value=\""+flashvars+"\">");
document.write("<embed src=\""+vPlayer+"\" wmode=\"opaque\" FlashVars=\""+flashvars+"\" menu=\"false\" bgcolor=\"#000000\" quality=\"high\" width=\""+ vWidth +"\" height=\""+ vHeight +"\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");
document.write("</object>");
//-->
</script>