联系官方销售客服

1835022288

028-61286886

POSCMS分享经验 版主:论坛审计组
实现视频定秒试看功能
类型:POSCMS 更新时间:2017-12-18 09:15:19

<script type="text/javascript" src="/api/ckplayer/ckplayer.js" charset="utf-8"></script>

<script type="text/javascript">

var isNumber={$forfree};//定义开关

var flashvars={

f:'{dr_get_video_url($video)}',

c:0,

p:0,

g:{$_REQUEST['pointtime']},

//j:,

loaded:'loadedHandler'

};

var video=['{dr_get_video_url($video)}->video/mp4'];

CKobject.embed('/api/ckplayer/ckplayer.swf','video','ckplayer_a1','100%','480',false,flashvars,video)//

function loadedHandler(){

CKobject.getObjectById('ckplayer_a1').addListener('time','timeHandler');

}

function timeHandler(t){

if(t>{dr_var("videofreetime")} && !isNumber){

CKobject.getObjectById('ckplayer_a1').videoPause();

//CKobject.getObjectById('ckplayer_a1').removeListener('time','timeHandler');

//isNumber=false;

alert('付费后收看完整视频');

CKobject.getObjectById('ckplayer_a1').videoSeek(0);

CKobject.getObjectById('ckplayer_a1').videoPause();

}

}

</script>


回帖
  • xgocn
    #1楼    xgocn
    2017-12-18 09:07:26
    0
    {dr_var("videofreetime")}是一个全局变量
  • 老赵
    #2楼    老赵
    2017-12-18 09:07:51
    0
    {dr_var("videofreetime")}是调用哪里的
  • xgocn
    #3楼    xgocn
    2017-12-18 09:15:19
    0
    定义一个全局变量