aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Potts <sam@selz.com>2016-07-25 08:53:29 +1000
committerGitHub <noreply@github.com>2016-07-25 08:53:29 +1000
commita0ddc5e6eb4802927caaad344a5babda83e6d7c9 (patch)
tree00b57bc13e37700692e37a6911e7050e9b21a414
parentd7cc29f2fbc046f8b78a558df9c5504f8e608326 (diff)
parentdc40b1f93a7cb400d9ee07351e0d4c532e8050a6 (diff)
downloadplyr-a0ddc5e6eb4802927caaad344a5babda83e6d7c9.tar.lz
plyr-a0ddc5e6eb4802927caaad344a5babda83e6d7c9.tar.xz
plyr-a0ddc5e6eb4802927caaad344a5babda83e6d7c9.zip
Merge pull request #321 from electerious/patch-1
Added Array as selector in .setup() to readme
-rw-r--r--readme.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/readme.md b/readme.md
index f853c12d..9782150e 100644
--- a/readme.md
+++ b/readme.md
@@ -172,7 +172,7 @@ WebVTT captions are supported. To add a caption track, check the HTML example ab
#### Initialising
-By default, Plyr looks for all `<video>`, `<audio>` and `[data-type]` elements with the document and initialises on any found. You can specify other options, including a different NodeList, HTMLElement or string selector as below:
+By default, Plyr looks for all `<video>`, `<audio>` and `[data-type]` elements with the document and initialises on any found. You can specify other options, including a different NodeList, HTMLElement, Array of HTMLElements or string selector as below:
Passing a [NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList):
```javascript
@@ -184,6 +184,14 @@ Passing a [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElemen
plyr.setup(document.querySelector('.js-player'), options);
```
+Passing an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement)s:
+```javascript
+plyr.setup([
+ document.querySelector('.js-player'),
+ document.querySelector('.another-js-player')
+], options);
+```
+
Passing a [string selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll):
```javascript
plyr.setup('.js-player', options);