优酷视频组件,优酷视频api,优酷视频js调用
分享知识http://www.fedrobots.com/?search=74498我来纠错<div id="youkuplayer" style="width:600px;height:400px"></div>
<script type="text/javascript" src="http://player.youku.com/jsapi"></script>
<script type="text/javascript">
var player = new YKU.Player('youkuplayer',{
styleid: '0', //默认值无视掉
client_id: '00bee4cf552a6f49', //优酷视频开发者授权网站的client_id
vid: 'XNjc3NjQ0MTM2', //视频id
autoplay: true,//是否自动播放
newPlayer: true,
show_related: false , //结束后是否显示相关视频
events:{
///onPlayerReady: function(){ alert('准备好了') },
//onPlayStart: function(){ alert('正式开始') },
onPlayEnd: function(){ alert('结束了') }//结束执行事件
}
});
//视频播放
function playVideo(){
player.playVideo();
}
//视频暂停
function pauseVideo(){
player.pauseVideo();
}
</script>