Skip to content

Commit

Permalink
docs: Remove data-setup property to prevent double initialization (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
izkmdz committed Feb 23, 2022
1 parent 8b1a082 commit 72bb456
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ instance of a `video.js` player.
#### Using `<source>`

```html
<video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" data-setup='{}'>
<video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268">
<source src="https://example.com/video_720.mp4" type="video/mp4" label="720P">
<source src="https://example.com/video_480.mp4" type="video/mp4" label="480P" selected="true">
<source src="https://example.com/video_360.mp4" type="video/mp4" label="360P">
Expand Down Expand Up @@ -114,7 +114,10 @@ There are at least two ways to add the quality selector control to the player's
bar. The first is directly adding it via `addChild`. For example:

```js
player.controlBar.addChild('QualitySelector');
videojs('video_1', {}, function() {
var player = this;
player.controlBar.addChild('QualitySelector');
});
```

The second option is to add the control via the player's options, for instance:
Expand Down
4 changes: 2 additions & 2 deletions docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<body>
<h1>Demo of <code>videojs-quality-selector</code></h1>

<video id="video_1" class="video-js vjs-default-skin" controls preload="auto" data-setup='{}'>
<video id="video_1" class="video-js vjs-default-skin" controls preload="auto">
<source src="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/ab/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm.720p.webm" type="video/webm" label="720P">
<source src="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/ab/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm.480p.webm" type="video/webm" label="480P" selected="true">
<source src="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/ab/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm.360p.webm" type="video/webm" label="360P">
<source src="https://upload.wikimedia.org/wikipedia/commons/transcoded/a/ab/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm/Caminandes_3_-_Llamigos_-_Blender_Animated_Short.webm.240p.webm" type="video/webm" label="240P">
</video>

<script>
videojs("video_1", {}, function() {
videojs('video_1', {}, function() {
var player = this;

player.controlBar.addChild('QualitySelector');
Expand Down

0 comments on commit 72bb456

Please sign in to comment.