Skip to content

Commit

Permalink
update docs for first release
Browse files Browse the repository at this point in the history
  • Loading branch information
CHENJIN committed Nov 25, 2016
1 parent 2a14226 commit da7f60f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ksplayer demo</title>
<link rel="stylesheet" href="style/ksplayer.min.css">
<!--<link rel="stylesheet" href="style/ksplayer.min.css">-->
<link href="//ksplayer.video.ksyun.com/v1/ksplayer.min.css" rel="stylesheet">

<style>
body {
Expand Down Expand Up @@ -68,7 +69,7 @@ <h1>KSPlayer Demo</h1>
<p>KSPlayer让您可以在所有主要的桌面和移动端浏览器上播放mp4,m3u8格式的点播视频和rtmp、hls、http-flv协议的直播视频</p>
<div class="video-container">
<!--two choices for style: vjs-default-skin or vjs-sublime-skin-->
<video id=example-video class="video-js vjs-big-play-centered" controls preload="auto" width="640" height="264">
<video id=example-video class="video-js mobile-first-skin" controls preload="auto" width="640" height="264">
<source src="http://vjs.zencdn.net/v/oceans.mp4"
type="video/mp4">
</video>
Expand All @@ -77,7 +78,8 @@ <h1>KSPlayer Demo</h1>
<input id="video-url" placeholder="输入视频URL"> <button id="change-video">加载</button>
</div>

<script src="js/ksplayer.min.js"></script>
<!--<script src="js/ksplayer.min.js"></script>-->
<script src="//ksplayer.video.ksyun.com/v1/ksplayer.min.js"></script>

<!--<script>-->
<!--ksplayer.options.flash.swf = "ksplayer.swf";-->
Expand All @@ -88,33 +90,30 @@ <h1>KSPlayer Demo</h1>

var player = ksplayer('example-video',{
language: 'zh-CN',
responsive: true,
autoHeight: true,
autoWidth: true,
fluid: true, //响应式
bigPlayButton: false,
autoplay:false
autoplay:false,
controlBar: {
volumeMenuButton: {
inline: false,
vertical: true
}
}
// "playbackRates": [1, 1.5, 2]
});


var bigBtn = player.addChild("BigPlayButton");
//player.removeChild("BigPlayButton");
var el = bigBtn.el();

player.ready(function() {
bigBtn.addClass('wider-style');
//bigBtn.addClass('wider-style');
setTimeout(function() {
console.log('lengthOfVideo: ' + player.duration());
},1);

/* if(player.currentSrc() == 'http://vjs.zencdn.net/v/oceans.mp4') {
var trackElement = player.addRemoteTextTrack({
kind: 'Captions',
label:'打开字幕',
language: 'zh',
src: './captions.vtt',
default: true
});
}*/

$("#change-video")[0].addEventListener('click', function(){
var newUrl = $('#video-url')[0].value.trim();
Expand Down Expand Up @@ -187,11 +186,11 @@ <h1>KSPlayer Demo</h1>


player.on("useractive", function(event) {
console.log( event );
//console.log( event );
});

player.on("userinactive", function(event) {
console.log( event );
//console.log( event );
});

player.on("volumechange", function(event) {
Expand All @@ -206,6 +205,7 @@ <h1>KSPlayer Demo</h1>
console.log(event);
});


</script>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</p>
</video>
```
ksplayer提供了两套皮肤,默认样式和高级样式,可以分别通过在class属性中增加`js-default-skin``js-sublime-skin`类更换播放器皮肤。另外通过添加额外的`vjs-big-play-centered`类可以使播放按钮居中。
ksplayer提供了两套皮肤,默认样式和高级样式,可以分别通过在class属性中增加`js-default-skin`,`js-sublime-skin``mobile-first-skin`类更换播放器皮肤。另外通过添加额外的`vjs-big-play-centered`类可以使播放按钮居中。

## Step 3: 初始化设置播放器
---
Expand Down

0 comments on commit da7f60f

Please sign in to comment.