Skip to content

Commit

Permalink
Fix for YouTube .getVideoData() issue (fixes #709)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampotts committed Nov 14, 2017
1 parent 0ec0add commit 9c4b53d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v2.0.18
- Fix for YouTube .getVideoData() issue (fixes #709)

## v2.0.17
- Vimeo controls fix (fixes #697)
- SVG4everybody compatibility fix
Expand Down
2 changes: 1 addition & 1 deletion dist/plyr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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": "2.0.17",
"version": "2.0.18",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Include the `plyr.js` script before the closing `</body>` tag and then call `ply
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript, you can use the following:

```html
<script src="https://cdn.plyr.io/2.0.17/plyr.js"></script>
<script src="https://cdn.plyr.io/2.0.18/plyr.js"></script>
```

### CSS
Expand All @@ -150,11 +150,11 @@ Include the `plyr.css` stylsheet into your `<head>`
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:

```html
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.17/plyr.css">
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.18/plyr.css">
```

### SVG Sprite
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). 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.17/plyr.svg`.
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). 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.18/plyr.svg`.

## Advanced

Expand Down
10 changes: 6 additions & 4 deletions src/js/plyr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v2.0.17
// plyr.js v2.0.18
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================
Expand Down Expand Up @@ -44,7 +44,7 @@
displayDuration: true,
loadSprite: true,
iconPrefix: 'plyr',
iconUrl: 'https://cdn.plyr.io/2.0.17/plyr.svg',
iconUrl: 'https://cdn.plyr.io/2.0.18/plyr.svg',
blankUrl: 'https://cdn.plyr.io/static/blank.mp4',
clickToPlay: true,
hideControls: true,
Expand Down Expand Up @@ -1768,8 +1768,10 @@
plyr.media.currentTime = 0;
plyr.media.muted = instance.isMuted();

// Set title
config.title = instance.getVideoData().title;
// Set title if possible
if (typeof instance.getVideoData === 'function') {
config.title = instance.getVideoData().title;
}

// Set the tabindex
if (plyr.supported.full) {
Expand Down

0 comments on commit 9c4b53d

Please sign in to comment.