Merge pull request #321 from electerious/patch-1
Added Array as selector in .setup() to readme
This commit is contained in:
		
							
								
								
									
										10
									
								
								readme.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								readme.md
									
									
									
									
									
								
							| @ -172,7 +172,7 @@ WebVTT captions are supported. To add a caption track, check the HTML example ab | |||||||
|  |  | ||||||
| #### Initialising | #### 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): | Passing a [NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList): | ||||||
| ```javascript | ```javascript | ||||||
| @ -184,6 +184,14 @@ Passing a [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElemen | |||||||
| plyr.setup(document.querySelector('.js-player'), options); | 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): | Passing a [string selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll): | ||||||
| ```javascript | ```javascript | ||||||
| plyr.setup('.js-player', options); | plyr.setup('.js-player', options); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user