借用保利威视播放器的watch_end_time参数,限制播放器播放时间。 然后利用播放器的播放结束事件,触发到s2j_onPlayOver,把播放器隐藏,显示一张图片,引导用户注册或购买。
按源码方式贴到自己网站,修改flashvars参数的value,增加watch_end_time=10,如果是5分钟,则设置为watch_end_time=300
<span id="player"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" height="340" id="polyv_player" width="640"><param name="movie" value="http://player.polyv.net/videos/cc3b755ad24a2c9bf54bcffef6a51453_c.swf" /><param name="allowscriptaccess" value="always" /><param name="flashVars" value="watch_end_time=10" /><param name="allowFullScreen" value="true" /><embed allowfullscreen="true" allowscriptaccess="always" flashvars="watch_end_time=10" height="340" name="polyv_player" src="http://player.polyv.net/videos/cc3b755ad24a2c9bf54bcffef6a51453_c.swf" type="application/x-shockwave-flash" width="640"></embed></object></span>
<span id="buylink"><a href="http://pay.polyv.net/purchase.htm?packageId=12"><img alt="" src="/uploads/allimg/130911/1-13091110350RR.png" /></a></span>
function s2j_onPlayOver()
{
//alert("播放结束");
document.getElementById("buylink").style.display = "block";
document.getElementById("player").style.display = "none";
}
function s2j_onPlayOver()
{
//alert("播放结束");
document.getElementById("buylink").style.display = "block";
document.getElementById("player").style.display = "none";
}