- Fixed `getCurrentTime()` method (fixes #351) - Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
This commit is contained in:
parent
15fd7041ab
commit
435b5c74bf
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## v2.0.7
|
||||
- Fixed `getCurrentTime()` method (fixes #351)
|
||||
- Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
|
||||
|
||||
## v2.0.6
|
||||
- Fixed merge issue with `Updated define to work with AMD imports #326` PR
|
||||
- Code formatting
|
||||
|
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "2.0.6",
|
||||
"version": "2.0.7",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "http://plyr.io",
|
||||
"main": "src/js/plyr.js",
|
||||
|
31
readme.md
31
readme.md
@ -122,7 +122,7 @@ Include the `plyr.js` script before the closing `</body>` tag and then call `ply
|
||||
If you want to use our CDN for the JavaScript, you can use the following:
|
||||
|
||||
```html
|
||||
<script src="https://cdn.plyr.io/2.0.6/plyr.js"></script>
|
||||
<script src="https://cdn.plyr.io/2.0.7/plyr.js"></script>
|
||||
```
|
||||
|
||||
### CSS
|
||||
@ -135,11 +135,11 @@ Include the `plyr.css` stylsheet into your `<head>`
|
||||
If you want to use our CDN for the default CSS, you can use the following:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.6/plyr.css">
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.7/plyr.css">
|
||||
```
|
||||
|
||||
### SVG Sprite
|
||||
The SVG sprite is loaded automatically from our CDN. To change this, see the [options](#Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.6/plyr.svg`.
|
||||
The SVG sprite is loaded automatically from our CDN. To change this, see the [options](#Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/2.0.7/plyr.svg`.
|
||||
|
||||
## Advanced
|
||||
|
||||
@ -529,6 +529,26 @@ Here's a list of the methods supported:
|
||||
<td>Number</td>
|
||||
<td>Seeks the media to the provided parameter, time in seconds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>getCurrentTime()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a float with the current time in seconds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>getDuration()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a float with the duration in seconds.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>getVolume()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a float between 0 and 1 for the current volume level.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>isMuted()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a boolean for whether the media is currently muted.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>setVolume(...)</code></td>
|
||||
<td>Number</td>
|
||||
@ -590,11 +610,6 @@ Here's a list of the methods supported:
|
||||
<td>—</td>
|
||||
<td>Restores the original element, reversing the effects of <code>setup()</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>getCurrentTime()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a float with the current time in seconds.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ==========================================================================
|
||||
// Plyr
|
||||
// plyr.js v2.0.6
|
||||
// plyr.js v2.0.7
|
||||
// https://github.com/selz/plyr
|
||||
// License: The MIT License (MIT)
|
||||
// ==========================================================================
|
||||
@ -43,7 +43,7 @@
|
||||
displayDuration: true,
|
||||
loadSprite: true,
|
||||
iconPrefix: 'plyr',
|
||||
iconUrl: 'https://cdn.plyr.io/2.0.6/plyr.svg',
|
||||
iconUrl: 'https://cdn.plyr.io/2.0.7/plyr.svg',
|
||||
clickToPlay: true,
|
||||
hideControls: true,
|
||||
showPosterOnEnd: false,
|
||||
@ -2205,7 +2205,9 @@
|
||||
}
|
||||
|
||||
// Toggle muted state
|
||||
if (plyr.media.muted && volume > 0) {
|
||||
if (volume === 0) {
|
||||
plyr.media.muted = true;
|
||||
} else if (plyr.media.muted && volume > 0) {
|
||||
_toggleMute();
|
||||
}
|
||||
}
|
||||
@ -3381,6 +3383,10 @@
|
||||
getEmbed: function() { return plyr.embed; },
|
||||
getMedia: function() { return plyr.media; },
|
||||
getType: function() { return plyr.type; },
|
||||
getDuration: _getDuration,
|
||||
getCurrentTime: function() { return plyr.media.currentTime; },
|
||||
getVolume: function() { return plyr.media.volume; },
|
||||
isMuted: function() { return plyr.media.muted; },
|
||||
isReady: function() { return _hasClass(plyr.container, config.classes.ready); },
|
||||
isLoading: function() { return _hasClass(plyr.container, config.classes.loading); },
|
||||
on: function(event, callback) { _on(plyr.container, event, callback); },
|
||||
@ -3401,8 +3407,7 @@
|
||||
toggleControls: _toggleControls,
|
||||
isFullscreen: function() { return plyr.isFullscreen || false; },
|
||||
support: function(mimeType) { return _supportMime(plyr, mimeType); },
|
||||
destroy: _destroy,
|
||||
getCurrentTime: function() { return media.currentTime; }
|
||||
destroy: _destroy
|
||||
};
|
||||
|
||||
// Everything done
|
||||
|
Loading…
x
Reference in New Issue
Block a user