From d46701e9ebf3d6d1dd756c2025ad9b8c1020244b Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Thu, 15 Nov 2018 15:33:47 +0800 Subject: [PATCH] update docd --- README.md | 469 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 318 insertions(+), 151 deletions(-) diff --git a/README.md b/README.md index 03a6227e2..8dbb5d355 100644 --- a/README.md +++ b/README.md @@ -653,15 +653,6 @@ var art = new Artplayer({ ## API -### Example - -```js -var art = new Artplayer({ - container: '.artplayer-app', - url: 'path/to/video.mp4' -}); -``` - ### Instance properties and methods @@ -685,13 +676,13 @@ var art = new Artplayer({ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
player Type: object
- Destroy instance, and whether to remove dom

+ Player core function

@@ -709,7 +700,7 @@ var art = new Artplayer({ @@ -717,7 +708,7 @@ var art = new Artplayer({ @@ -725,152 +716,328 @@ var art = new Artplayer({ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
mountUrl Type: function
- A special writable method for modifying the play url before play

+ A special writable method for modifying the play url before play
Demo @@ -701,7 +692,7 @@ var art = new Artplayer({ play Type: function
- Trigger play + Trigger play
null
pause Type: function
- Trigger pause + Trigger pause
null
toggle Type: function
- Trigger play or pause + Trigger play or pause
null
seek Type: function
- Custom play time in seconds + Custom play time in seconds
Demo
volume + Type: number
+ Get and set the volume
+
+ Demo +
currentTime + Type: number
+ Get and set current time
+
+ Demo +
duration + Type: number
+ Get duration in seconds
+
+ Demo +
switch + Type: function
+ Switch video url, use in the case of similar switching quality
+ You can also pass a name to the url for display, like:
+ art.player.switch(url, name)
+
+ Demo +
playbackRate + Type: function
+
+ Demo +
playbackRateState + Type: boolean
+
+ Demo +
playbackRateRemove + Type: function
+
+ Demo +
playbackRateReset + Type: function
+
+ Demo +
aspectRatio + Type: function
+
+ Demo +
aspectRatioState + Type: boolean
+
+ Demo +
aspectRatioRemove + Type: function
+
+ Demo +
aspectRatioReset + Type: function
+
+ Demo +
screenshot + Type: function
+
+ Demo +
fullscreenState + Type: boolean
+
+ Demo +
fullscreenEnabled + Type: function
+
+ Demo +
fullscreenExit + Type: function
+
+ Demo +
fullscreenToggle + Type: function
+
+ Demo +
fullscreenWebState + Type: boolean
+
+ Demo +
fullscreenWebEnabled + Type: function
+
+ Demo +
fullscreenWebExit + Type: function
+
+ Demo +
fullscreenWebToggle + Type: function
+
+ Demo +
pipState + Type: boolean
+
+ Demo +
pipDraggie + Type: function
+
+ Demo +
pipEnabled + Type: function
+
+ Demo +
pipExit + Type: function
+
+ Demo +
pipToggle + Type: function
+
+ Demo +
loaded + Type: number
+
+ Demo +
played + Type: number
+
+ Demo +
autoSize + Type: function
+
+ Demo +
autoSizeState + Type: boolean
+
+ Demo +
autoSizeRemove + Type: function
+
+ Demo +
flip + Type: function
+
+ Demo +
flipState + Type: boolean
+
+ Demo +
flipRemove + Type: function
+
+ Demo +
null
art.player.volumeGet and set the player volume - Demo -
art.player.currentTimeGet player current time - Demo -
art.player.durationGet player duration in seconds - Demo -
art.player.switch() - Switch video url, use in the case of similar switching quality
- You can also pass a name to the url for display, like:
- art.player.switch(url, name) -
- Demo -
- art.player.playbackRate()
- art.player.playbackRateState
- art.player.playbackRateRemove()
- art.player.playbackRateReset() -
Manage the playback rate, at intervals of 0.1 to 10 - Demo -
- art.player.aspectRatio()
- art.player.aspectRatioState
- art.player.aspectRatioRemove()
- art.player.aspectRatioReset() -
- Demo -
art.player.screenshot() - Demo -
- art.player.fullscreenState
- art.player.fullscreenEnabled()
- art.player.fullscreenExit()
- art.player.fullscreenToggle() -
- Demo -
- art.player.fullscreenWebState
- art.player.fullscreenWebEnabled()
- art.player.fullscreenWebExit()
- art.player.fullscreenWebToggle() -
- Demo -
- art.player.pipState
- art.player.pipDraggie
- art.player.pipEnabled()
- art.player.pipExit()
- art.player.pipToggle() -
- Demo -
art.player.loaded - Demo -
art.player.played - Demo -
- art.player.autoSize()
- art.player.autoSizeState
- art.player.autoSizeRemove() -
- Demo -
- art.player.flip()
- art.player.flipState
- art.player.flipRemove()
-
- Demo -
### Class static properties and methods