From 2bbf1a04f6d8cb0cea7474b517e25a708ccb3e50 Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Tue, 27 Nov 2018 18:13:07 +0800 Subject: [PATCH] docs update --- docs/docs/README.md | 107 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/docs/docs/README.md b/docs/docs/README.md index e40cb6c06..227bb9909 100644 --- a/docs/docs/README.md +++ b/docs/docs/README.md @@ -1158,6 +1158,113 @@ art.on('firstCanplay', () => { }); ``` +### currentTime + +- Type: `Number` + +`Geter` and `Setter` of the current time + +[Run Code](/) + +```js +var url = 'https://blog.zhw-island.com/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/one-more-time-one-more-chance-480p.mp4', +}); + +art.on('firstCanplay', () => { + console.log(art.player.currentTime); + art.player.currentTime = 5; + console.log(art.player.currentTime); +}); +``` + +### duration + +- Type: `Number` + +`Geter` of the duration + +[Run Code](/) + +```js +var url = 'https://blog.zhw-island.com/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/one-more-time-one-more-chance-480p.mp4', +}); + +art.on('firstCanplay', () => { + console.log(art.player.duration); +}); +``` + +### flipState + +- Type: `String` +- Default: `''` + +Return the current state of flip + +[Run Code](/) + +```js +var url = 'https://blog.zhw-island.com/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/one-more-time-one-more-chance-480p.mp4', +}); + +art.on('firstCanplay', () => { + console.log(art.player.flipState); +}); +``` + +### flip + +- Type: `Function` + +Set flip, Currently only accepts three values:`normal`, `horizontal`, `vertical` + +[Run Code](/) + +```js +var url = 'https://blog.zhw-island.com/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/one-more-time-one-more-chance-480p.mp4', +}); + +art.on('firstCanplay', () => { + art.player.flip('horizontal); + console.log(art.player.flipState); +}); +``` + +### flipRemove + +- Type: `Function` + +Remove the flip + +[Run Code](/) + +```js +var url = 'https://blog.zhw-island.com/assets-cdn'; +var art = new Artplayer({ + container: '.artplayer-app', + url: url + '/video/one-more-time-one-more-chance-480p.mp4', +}); + +art.on('firstCanplay', () => { + art.player.flip('horizontal); + setTimeout(function() { + art.player.flipRemove(); + }, 1000); +}); +``` + ## storage - Type: `Object`