SASS fixes, docs changes (fixes #180), 'ready' event

This commit is contained in:
Sam Potts
2016-03-13 21:45:57 +11:00
parent 01b45e7d97
commit 5ea9e59d71
6 changed files with 28 additions and 14 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## v1.5.18
- Added 'ready' event for initial setup complete or source change occurs
- Fixed SASS stylesheet references to transparentize
- Added default font stack to controls
- Docs fixes inc controls HTML (fixes #180)
## v1.5.17
- Expose YouTube and Vimeo API (docs update required) (Fixes #176)
- Auto set title based on YouTube getVideoData() title property

View File

@ -81,11 +81,11 @@ var controls = ["<div class='plyr__controls'>",
"</button>",
"<span class='plyr__time'>",
"<span class='plyr__sr-only'>Current time</span>",
"<span class='plyr__current-time'>00:00</span>",
"<span class='plyr__time--curent'>00:00</span>",
"</span>",
"<span class='plyr__time'>",
"<span class='plyr__sr-only'>Duration</span>",
"<span class='plyr__duration'>00:00</span>",
"<span class='plyr__time--duration'>00:00</span>",
"</span>",
"</span>",
"<span class='plyr__controls--right'>",

4
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "1.5.17",
"version": "1.5.18",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",

View File

@ -40,7 +40,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.5.17/plyr.js` to `https://cdn.plyr.io/1.5.17/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.5.18/plyr.js` to `https://cdn.plyr.io/1.5.18/plyr.js`
### Node Package Manager (NPM)
Using NPM, you can grab Plyr:
@ -69,11 +69,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.5.17/plyr.css">
<script src="https://cdn.plyr.io/1.5.17/plyr.js"></script>
<link rel="stylesheet" href="https://cdn.plyr.io/1.5.18/plyr.css">
<script src="https://cdn.plyr.io/1.5.18/plyr.js"></script>
```
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.17/sprite.svg`.
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.18/sprite.svg`.
### CSS & Styling
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.
@ -175,7 +175,7 @@ Be sure to [validate your caption files](https://quuz.org/webvtt/)
Here's an example of a default setup:
```html
<script src="https://cdn.plyr.io/1.5.17/plyr.js"></script>
<script src="https://cdn.plyr.io/1.5.18/plyr.js"></script>
<script>plyr.setup();</script>
```
@ -675,7 +675,7 @@ You can listen for events on the element you setup Plyr on. Some events only app
<td>Sent when an error occurs.&nbsp; The element's <code>error</code> attribute contains more information.</td>
</tr>
<tr>
<td><code>loadeddata/code></td>
<td><code>loadeddata</code></td>
<td>✔</td>
<td>The first frame of the media has finished loading.</td>
</tr>
@ -759,6 +759,11 @@ You can listen for events on the element you setup Plyr on. Some events only app
<td></td>
<td>Captions toggled off</td>
</tr>
<tr>
<td><code>ready</code></td>
<td></td>
<td>Triggered when initial setup is done or a source change has occurred.</td>
</tr>
</tbody>
</table>
@ -767,7 +772,7 @@ Details borrowed from: [https://developer.mozilla.org/en-US/docs/Web/Guide/Event
Here's an example of binding an event listener:
```javascript
document.querySelector(".js-plyr").addEventListener("playing", function() {
document.querySelector(".js-plyr").addEventListener("ready", function() {
/* Magic happens */
});
```

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v1.5.17
// plyr.js v1.5.18
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@ -1242,7 +1242,7 @@
// Toggle style hook
function _toggleStyleHook() {
_toggleClass(plyr.container, defaults.selectors.container.replace('.', ''), plyr.supported.full);
_toggleClass(plyr.container, config.selectors.container.replace('.', ''), plyr.supported.full);
}
// Toggle native controls
@ -2730,6 +2730,9 @@
// Display duration
_displayDuration();
// Ready event
_triggerEvent(plyr.container, 'ready');
}
// Initialize instance