Fix for embed property not being set
This commit is contained in:
parent
5ea9e59d71
commit
b51a1684dc
2
dist/plyr.js
vendored
2
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "1.5.18",
|
"version": "1.5.19",
|
||||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||||
"homepage": "http://plyr.io",
|
"homepage": "http://plyr.io",
|
||||||
"main": "src/js/plyr.js",
|
"main": "src/js/plyr.js",
|
||||||
|
36
readme.md
36
readme.md
@ -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.
|
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.18/plyr.js` to `https://cdn.plyr.io/1.5.18/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.19/plyr.js` to `https://cdn.plyr.io/1.5.19/plyr.js`
|
||||||
|
|
||||||
### Node Package Manager (NPM)
|
### Node Package Manager (NPM)
|
||||||
Using NPM, you can grab Plyr:
|
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:
|
If you want to use our CDN, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/1.5.18/plyr.css">
|
<link rel="stylesheet" href="https://cdn.plyr.io/1.5.19/plyr.css">
|
||||||
<script src="https://cdn.plyr.io/1.5.18/plyr.js"></script>
|
<script src="https://cdn.plyr.io/1.5.19/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.18/sprite.svg`.
|
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.19/sprite.svg`.
|
||||||
|
|
||||||
### CSS & Styling
|
### 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.
|
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:
|
Here's an example of a default setup:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/1.5.18/plyr.js"></script>
|
<script src="https://cdn.plyr.io/1.5.19/plyr.js"></script>
|
||||||
<script>plyr.setup();</script>
|
<script>plyr.setup();</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -772,8 +772,8 @@ Details borrowed from: [https://developer.mozilla.org/en-US/docs/Web/Guide/Event
|
|||||||
Here's an example of binding an event listener:
|
Here's an example of binding an event listener:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
document.querySelector(".js-plyr").addEventListener("ready", function() {
|
document.querySelector('.js-plyr').addEventListener('ready', function() {
|
||||||
/* Magic happens */
|
var player = event.target.plyr;
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -781,6 +781,28 @@ document.querySelector(".js-plyr").addEventListener("ready", function() {
|
|||||||
|
|
||||||
YouTube and Vimeo are currently supported and function much like a HTML5 video. Check the relevant documentation sections for any differences.
|
YouTube and Vimeo are currently supported and function much like a HTML5 video. Check the relevant documentation sections for any differences.
|
||||||
|
|
||||||
|
Plyr references a custom version of the Vimeo Froogaloop API as Vimeo have neglected to maintain the library and there were bugs with their version. You don't need to worry about including your own versions of the Vimeo or YouTube JavaScript APIs.
|
||||||
|
|
||||||
|
The native API's can be accessed through the `embed` property of the plyr object. For example:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
document.querySelector('.js-plyr').addEventListener('ready', function() {
|
||||||
|
var player = event.target.plyr;
|
||||||
|
|
||||||
|
// YouTube
|
||||||
|
console.log(player.embed.getVideoData());
|
||||||
|
|
||||||
|
// Vimeo
|
||||||
|
console.log(player.embed.api('getColor'));
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
More info on the respective API's here:
|
||||||
|
[YouTube API Reference](https://developers.google.com/youtube/js_api_reference)
|
||||||
|
[Vimeo API Reference](https://developer.vimeo.com/player/js-api#reference)
|
||||||
|
|
||||||
|
*Please note*: not all API methods may work 100%. Your mileage may vary. It's better to use the universal plyr API where possible.
|
||||||
|
|
||||||
## Fullscreen
|
## Fullscreen
|
||||||
|
|
||||||
Fullscreen in Plyr is supported for all browsers that [currently support it](http://caniuse.com/#feat=fullscreen). If you're using the default CSS, you can also use a "full browser" mode which will use the full browser window by adding the `plyr-fullscreen` class to your container.
|
Fullscreen in Plyr is supported for all browsers that [currently support it](http://caniuse.com/#feat=fullscreen). If you're using the default CSS, you can also use a "full browser" mode which will use the full browser window by adding the `plyr-fullscreen` class to your container.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr
|
// Plyr
|
||||||
// plyr.js v1.5.18
|
// plyr.js v1.5.19
|
||||||
// https://github.com/selz/plyr
|
// https://github.com/selz/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@ -1415,14 +1415,14 @@
|
|||||||
|
|
||||||
// When embeds are ready
|
// When embeds are ready
|
||||||
function _embedReady() {
|
function _embedReady() {
|
||||||
// Setup the UI
|
|
||||||
_setupInterface();
|
|
||||||
|
|
||||||
// Set title
|
// Set title
|
||||||
_setTitle(_getElement('iframe'));
|
_setTitle(_getElement('iframe'));
|
||||||
|
|
||||||
// Store reference to API
|
// Store reference to API
|
||||||
plyr.container.plyr.embed = plyr.embed;
|
plyr.container.plyr.embed = plyr.embed;
|
||||||
|
|
||||||
|
// Setup the UI
|
||||||
|
_setupInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle YouTube API ready
|
// Handle YouTube API ready
|
||||||
|
Loading…
x
Reference in New Issue
Block a user