优酷视频控制
2016-07-23 21:53
190 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> <title>js控制优酷视频播放</title> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://player.youku.com/jsapi"></script> <script> player = new YKU.Player('youkuplayer',{ styleid: '0', client_id: 'd8781b239fdad45b', vid: 'XMjg1MTcyNDQ0', autoplay: false, show_related: true, events:{ onPlayEnd: function(){ }, onPlayStart: function(){ }, onPlayerReady: function(){ } } }); function playVideo(){ try{ player.playVideo(); } catch(err){ alert("*"+err); } } function pauseVideo(){ player.pauseVideo(); } function seekTo(s){ player.seekTo(s); } function currentTime(){ return player.currentTime(); } </script> </head> <body> <div id="youkuplayer" style="width:100%;height:400px;"></div> <br /> <input type="button" onclick="playVideo();" value="播放" style="height:30px;width:50px;"> <input type="button" onclick="pauseVideo();" value="暂停" style="height:30px;width:50px;"> </body> </html>
查看API请移步:http://doc.open.youku.com/
相关文章推荐
- log4net使用简介
- php7开启强类型模式
- 分享一篇利用poi 写的将excel转化为map的方法
- Jam's math problem<hdoj5615>
- HDU:5615 Jam's math problem(暴力,数学)
- Spark MLlib之分类模型源码分析
- Android设置透明、半透明等效果
- Qt带来的是更加低廉的开发成本和学习成本,对于很多小公司而言,这种优势足以让他们获得更大的利润空间 good
- Roman to Integer
- 寻找Coder(toupper 的用法)--------去哪儿2015研发工程师笔试题
- 关于CUDA实现最值问题
- POJ3438 ZOJ2886 UVALive3822 Look and Say【数列+水题】
- Dialog源码分析
- 组合问题与动态规划的联系之应用
- 适配器(一)
- Log4Net使用详解
- poj1703 并查集
- 关键字、结构体总结以及typedef,枚举与#define区别
- 8086汇编语言自学经验分享 除数16位的DIV指令
- (linux)idr(integer ID management)机制