Skip to content

Commit

Permalink
Fixes bug with 1.1.8 volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Potts committed May 18, 2015
1 parent ceace2a commit 19d7522
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion dist/plyr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Docs styles -->
<link rel="stylesheet" href="//cdn.plyr.io/1.1.8/docs.css">
<link rel="stylesheet" href="//cdn.plyr.io/1.1.9/docs.css">
</head>
<body>
<main>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Styles -->
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.8/plyr.css">
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.9/plyr.css">

<!-- Docs styles -->
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.8/docs.css">
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.9/docs.css">
</head>
<body>
<header>
Expand Down Expand Up @@ -79,13 +79,13 @@ <h1>Plyr</h1>
b.insertBefore(c, b.childNodes[0]);
}
}
})(document, "https://cdn.plyr.io/1.1.8/sprite.svg");
})(document, "https://cdn.plyr.io/1.1.9/sprite.svg");
</script>

<!-- Plyr core script -->
<script src="https://cdn.plyr.io/1.1.8/plyr.js"></script>
<script src="https://cdn.plyr.io/1.1.9/plyr.js"></script>

<!-- Docs script -->
<script src="https://cdn.plyr.io/1.1.8/docs.js"></script>
<script src="https://cdn.plyr.io/1.1.9/docs.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "1.1.8",
"version": "1.1.9",
"description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io",
"main": "gulpfile.js",
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you have any cool ideas or features, please let me know by [creating an issue

Check `docs/index.html` and `docs/dist/docs.js` for an example setup.

**Heads up**, the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.1.8/plyr.js` to `https://cdn.plyr.io/1.1.8/plyr.js`
**Heads up**, the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.1.9/plyr.js` to `https://cdn.plyr.io/1.1.9/plyr.js`

### Bower
If bower is your thang, you can grab Plyr using:
Expand All @@ -57,11 +57,11 @@ More info is on [npm](https://www.npmjs.com/package/ember-cli-plyr) and [GitHub]
If you want to use our CDN, you can use the following:

```html
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.8/plyr.css">
<script src="https://cdn.plyr.io/1.1.8/plyr.js"></script>
<link rel="stylesheet" href="https://cdn.plyr.io/1.1.9/plyr.css">
<script src="https://cdn.plyr.io/1.1.9/plyr.js"></script>
```

You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.1.8/sprite.svg`.
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.1.9/sprite.svg`.

### CSS
If you want to use the default css, add the `plyr.css` file from /dist into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request.
Expand Down
14 changes: 8 additions & 6 deletions src/js/plyr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v1.1.8
// plyr.js v1.1.9
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
Expand Down Expand Up @@ -1167,6 +1167,11 @@

// Set the player volume
player.media.volume = parseFloat(volume / 10);

// Toggle muted state
if(player.media.muted && volume > 0) {
_toggleMute();
}
}

// Mute
Expand All @@ -1189,18 +1194,15 @@
if(player.supported.full && player.volume) {
player.volume.value = volume;
}
// Update mute button state
if(player.supported.full && player.buttons.mute) {
player.buttons.mute.checked = player.media.muted;
}

// Store the volume in storage
if(config.storage.enabled && _storage().supported) {
window.localStorage.setItem(config.storage.key, volume);
}

// Toggle class if muted
_toggleClass(player.container, config.classes.muted, volume === 0);
_toggleClass(player.container, config.classes.muted, (volume === 0));
player.buttons.mute.checked = (volume === 0);
}

// Toggle captions
Expand Down

0 comments on commit 19d7522

Please sign in to comment.