例1-1:PHP函数:base64_encode() 使用介绍
<!--X2 CrossPlatform /begin -->
<script src="js/base.js"></script>
<div class="video" id="CuPlayer" >
<SCRIPT LANGUAGE=JavaScript>
<!--
/*
* 跨平台方案X2(基于HTTP协议+ RTMP协议)========
* @param {Object} vID ID
* @param {Object} vWidth 播放器宽度设置
* @param {Object} vHeight 播放器高度设置
* @param {Object} vFile 播放器配置文件
* @param {Object} vPlayer 播放器文件
* @param {Object} vPic 视频缩略图
* @param {Object} vCssurl 移动端CSS应用文件
* @param {Object} vServer RTMP服务器地址
* @param {Object} vMp4url RTMP视频文件地址
* @param {Object} vIosurl 视频文件地址
* 跨平台方案说明=============================
* 本实例请在IIS/Apache等网站环境下测试
* 本实例实现基于HTTP协议+ RTMP协议下的跨平台
* 本实例要求用户有RTMP流媒体环境
* 本实例要求[视频文件地址]为mp4格式
*/
var vID = "";
var vWidth = "100%"; //播放器宽度设置
var vHeight = 400; //播放器高度设置
var vFile = "CuSunV4set.xml"; //播放器配置文件
var vPlayer = "player.swf?v=4.0";//播放器文件
var vPic = "images/start.jpg";//视频缩略图
var vCssurl = "images/mini.css"; //移动端CSS应用文件
//PC端
var vServer = ""; //无RTMP服务器时/此处设为空
var vMp4url = "aHR0cDovL3Byb21vdGlvbi5nZWVseS5jb20vaGFvcWluZy9hc3NldHMvdmlkZW8xLm1wNA==";
//安卓端,iOS端,wp(以下地址可以是mp4或m3u8地址)
var vIosurl = de("aHR0cDovL3Byb21vdGlvbi5nZWVseS5jb20vaGFvcWluZy9hc3NldHMvdmlkZW8xLm1wNA==");
//-->
</SCRIPT>
<script class="CuPlayerVideo" data-mce-role="CuPlayerVideo" type="text/javascript" src="js/CuSunX2.min.js"></script>
</div>
<!--X2 CrossPlatform /end -->
// 本范例演示地址:http://www.cuplayer.com/cu/Encrypt/b/demoX2.html
例1-2:PHP调用示例
// test.php 调用范例
<!--酷播播放器/代码开始-->
<?php
$str = 'http://promotion.geely.com/gc9/video/launch.mp4';
?>
<script type="text/javascript" src="/Cu/Encrypt/B/js/swfobject.js"></script>
<div class="video" id="CuPlayer" style="width:980px; height:510px;"><b><img src="/Cu/Encrypt/images/loading.gif" /> 网页视频播放器加载中,请稍后...<a href="http://www.cuplayer.com/cuplayer" target="_blank">点此升级>></a></b></div>
<script type="text/javascript">
var so = new SWFObject("/Cu/Encrypt/B/player.swf","myCuPlayer","980","495","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","/Cu/Encrypt/B/CuSunV4set.xml"); //配置文件地址
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath","<?php echo base64_encode($str); ?>"); //视频地址
so.addVariable("JcScpImg","images/startpic.jpg"); //视频图片
so.addVariable("JcScpAutoPlay","yes"); //是否自动播放
so.write("CuPlayer");
</script>
<script language=javascript src="/Cu/Encrypt/B/js/jquery-1.4.2.min.js" type=text/javascript></script>
<script language=javascript src="/Cu/Encrypt/B/js/action.js" type=text/javascript></script>
<!--酷播播放器/代码结束-->
// 本范例演示地址:http://www.cuplayer.com/cu/Encrypt/b/indexphp.php
例1-3:ASP调用示例
// 本ASP调用范例感谢网友 "小兵仔QQ2752636956" 友情提供
<!--#include file="base64.asp"-->
<script type="text/javascript" src="/Cu/Encrypt/B/js/swfobject.js"></script>
<div class="video" id="CuPlayer" style="width:980px; height:510px;"><b><img src="/Cu/Encrypt/images/loading.gif" /> 网页视频播放器加载中,请稍后...<a href="http://www.cuplayer.com/cuplayer" target="_blank">点此升级>></a></b></div>
<script type="text/javascript">
var so = new SWFObject("/Cu/Encrypt/B/player.swf","myCuPlayer","980","495","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","/Cu/Encrypt/B/CuSunV4set.xml"); //配置文件地址
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath","<% =Encode64("http://demo.cuplayer.com/file/test.mp4") %>"); //视频文件地址
so.addVariable("JcScpImg","images/startpic.jpg"); //视频图片
so.addVariable("JcScpAutoPlay","yes"); //是否自动播放
so.write("CuPlayer");
</script>
<script language=javascript src="/Cu/Encrypt/B/js/jquery-1.4.2.min.js" type=text/javascript></script>
<script language=javascript src="/Cu/Encrypt/B/js/action.js" type=text/javascript></script>
<!--酷播播放器/代码结束-->
// 本范例演示地址:http://www.cuplayer.com/cu/Encrypt/B/indexASP.asp
例1-4:ASPX调用示例
整理中... ( 如果您有ASPX范例愿意友情提供,以方便更多朋友,欢迎加酷播交流QQ群 535553578,或联系QQ261532593,验证注明"提供范例" )