Merge branch 'master' into develop
# Conflicts: # demo/dist/demo.js # dist/plyr.css # dist/plyr.js
This commit is contained in:
commit
5cecf16d4f
18
.github/issue_template.md
vendored
Normal file
18
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
- [ ] Issue does not already exist
|
||||||
|
- [ ] Issue observed on https://plyr.io
|
||||||
|
|
||||||
|
### Expected behaviour
|
||||||
|
|
||||||
|
### Actual behaviour
|
||||||
|
|
||||||
|
### Environment
|
||||||
|
|
||||||
|
- Browser:
|
||||||
|
- Version:
|
||||||
|
- Operating System:
|
||||||
|
- Version:
|
||||||
|
|
||||||
|
### Steps to reproduce
|
||||||
|
-
|
||||||
|
|
||||||
|
### Relevant links
|
8
.github/pull_request_template.md
vendored
Normal file
8
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
### Link to related issue (if applicable)
|
||||||
|
|
||||||
|
### Sumary of proposed changes
|
||||||
|
|
||||||
|
### Task list
|
||||||
|
|
||||||
|
- [ ] Tested on [supported browsers](https://github.com/Selz/plyr#browser-support)
|
||||||
|
- [ ] Gulp build completed
|
11
.jsbeautifyrc
Normal file
11
.jsbeautifyrc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"html": {
|
||||||
|
"allowed_file_extensions": []
|
||||||
|
},
|
||||||
|
"css": {
|
||||||
|
"allowed_file_extensions": []
|
||||||
|
},
|
||||||
|
"js": {
|
||||||
|
"allowed_file_extensions": []
|
||||||
|
}
|
||||||
|
}
|
11
changelog.md
11
changelog.md
@ -1,5 +1,16 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v2.0.9
|
||||||
|
- Temporary patch for the YouTube API issues with `getDuration()` (relates to #374)
|
||||||
|
|
||||||
|
## v2.0.8
|
||||||
|
- Added `isPaused()` API method (thanks to @darrena092)
|
||||||
|
- Allowed `.on()` API method to be chainable (thanks to @gurupras) (fixes #357)
|
||||||
|
- Improved the "awful" rendering of captions on small screens in fullscreen mode (fixes #390)
|
||||||
|
- Fix for Firefox VTT compatibility (thanks to @magourex)
|
||||||
|
- Fix for Firefox Developer Edition blank video due to `-webkit-mask-image` issue (fixes #392)
|
||||||
|
- Added Issue and PR templates with the aim of reducing duplicate or duff issues
|
||||||
|
|
||||||
## v2.0.7
|
## v2.0.7
|
||||||
- Fixed `getCurrentTime()` method (fixes #351)
|
- Fixed `getCurrentTime()` method (fixes #351)
|
||||||
- Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
|
- Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
|
||||||
|
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
4
dist/plyr.js
vendored
4
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
16
gulpfile.js
16
gulpfile.js
@ -245,15 +245,15 @@ options = {
|
|||||||
// If aws is setup
|
// If aws is setup
|
||||||
if("cdn" in aws) {
|
if("cdn" in aws) {
|
||||||
var regex = "(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?",
|
var regex = "(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?",
|
||||||
cdnpath = new RegExp(aws.cdn.bucket + "\/" + regex, "gi"),
|
cdnpath = new RegExp(aws.cdn.domain + "\/" + regex, "gi"),
|
||||||
semver = new RegExp("v" + regex, "gi"),
|
semver = new RegExp("v" + regex, "gi"),
|
||||||
localPath = new RegExp("(\.\.\/)?dist", "gi"),
|
localPath = new RegExp("(\.\.\/)?dist", "gi"),
|
||||||
versionPath = "https://" + aws.cdn.bucket + "/" + version;
|
versionPath = "https://" + aws.cdn.domain + "/" + version;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Publish version to CDN bucket
|
// Publish version to CDN bucket
|
||||||
gulp.task("cdn", function () {
|
gulp.task("cdn", function () {
|
||||||
console.log("Uploading " + version + " to " + aws.cdn.bucket + "...");
|
console.log("Uploading " + version + " to " + aws.cdn.domain + "...");
|
||||||
|
|
||||||
// Upload to CDN
|
// Upload to CDN
|
||||||
return gulp.src(paths.upload)
|
return gulp.src(paths.upload)
|
||||||
@ -270,17 +270,17 @@ gulp.task("cdn", function () {
|
|||||||
|
|
||||||
// Publish to demo bucket
|
// Publish to demo bucket
|
||||||
gulp.task("demo", function () {
|
gulp.task("demo", function () {
|
||||||
console.log("Uploading " + version + " demo to " + aws.demo.bucket + "...");
|
console.log("Uploading " + version + " demo to " + aws.demo.domain + "...");
|
||||||
|
|
||||||
// Replace versioned files in readme.md
|
// Replace versioned files in readme.md
|
||||||
gulp.src([root + "/readme.md"])
|
gulp.src([root + "/readme.md"])
|
||||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
.pipe(replace(cdnpath, aws.cdn.domain + "/" + version))
|
||||||
.pipe(gulp.dest(root));
|
.pipe(gulp.dest(root));
|
||||||
|
|
||||||
// Replace versioned files in plyr.js
|
// Replace versioned files in plyr.js
|
||||||
gulp.src(path.join(root, "src/js/plyr.js"))
|
gulp.src(path.join(root, "src/js/plyr.js"))
|
||||||
.pipe(replace(semver, "v" + version))
|
.pipe(replace(semver, "v" + version))
|
||||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
.pipe(replace(cdnpath, aws.cdn.domain + "/" + version))
|
||||||
.pipe(gulp.dest(path.join(root, "src/js/")));
|
.pipe(gulp.dest(path.join(root, "src/js/")));
|
||||||
|
|
||||||
// Replace local file paths with remote paths in demo HTML
|
// Replace local file paths with remote paths in demo HTML
|
||||||
@ -320,14 +320,14 @@ gulp.task("demo", function () {
|
|||||||
|
|
||||||
// Open the demo site to check it's sweet
|
// Open the demo site to check it's sweet
|
||||||
gulp.task("open", function () {
|
gulp.task("open", function () {
|
||||||
console.log("Opening " + aws.demo.bucket + "...");
|
console.log("Opening " + aws.demo.domain + "...");
|
||||||
|
|
||||||
// A file must be specified or gulp will skip the task
|
// A file must be specified or gulp will skip the task
|
||||||
// Doesn't matter which file since we set the URL above
|
// Doesn't matter which file since we set the URL above
|
||||||
// Weird, I know...
|
// Weird, I know...
|
||||||
return gulp.src([paths.demo.root + "index.html"])
|
return gulp.src([paths.demo.root + "index.html"])
|
||||||
.pipe(open("", {
|
.pipe(open("", {
|
||||||
url: "http://" + aws.demo.bucket
|
url: "http://" + aws.demo.domain
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "2.0.7",
|
"version": "2.0.9",
|
||||||
"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",
|
||||||
|
13
readme.md
13
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:
|
If you want to use our CDN for the JavaScript, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/2.0.7/plyr.js"></script>
|
<script src="https://cdn.plyr.io/2.0.9/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
### CSS
|
### 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:
|
If you want to use our CDN for the default CSS, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.7/plyr.css">
|
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.9/plyr.css">
|
||||||
```
|
```
|
||||||
|
|
||||||
### SVG Sprite
|
### 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.7/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.9/plyr.svg`.
|
||||||
|
|
||||||
## Advanced
|
## Advanced
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ Here's a list of the methods supported:
|
|||||||
<tr>
|
<tr>
|
||||||
<td><code>on()</code></td>
|
<td><code>on()</code></td>
|
||||||
<td>String, Function</td>
|
<td>String, Function</td>
|
||||||
<td>Watch for an event (first argument) and run a callback function (second argument). This saves you doing your own <code>addEventListner</code> code.</td>
|
<td>Watch for an event (first argument) and run a callback function (second argument). This saves you doing your own <code>addEventListner</code> code. This is chainable.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>play()</code></td>
|
<td><code>play()</code></td>
|
||||||
@ -565,6 +565,11 @@ Here's a list of the methods supported:
|
|||||||
<td>Boolean</td>
|
<td>Boolean</td>
|
||||||
<td>Toggles playback for the player based on either the boolean argument or it's current state.</td>
|
<td>Toggles playback for the player based on either the boolean argument or it's current state.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>isPaused()</code></td>
|
||||||
|
<td>—</td>
|
||||||
|
<td>Will return a boolean for whether the media is currently paused.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>toggleMute()</code></td>
|
<td><code>toggleMute()</code></td>
|
||||||
<td>—</td>
|
<td>—</td>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr
|
// Plyr
|
||||||
// plyr.js v2.0.7
|
// plyr.js v2.0.9
|
||||||
// https://github.com/selz/plyr
|
// https://github.com/selz/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@ -45,7 +45,7 @@
|
|||||||
displayDuration: true,
|
displayDuration: true,
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/2.0.7/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/2.0.9/plyr.svg',
|
||||||
clickToPlay: true,
|
clickToPlay: true,
|
||||||
hideControls: true,
|
hideControls: true,
|
||||||
showPosterOnEnd: false,
|
showPosterOnEnd: false,
|
||||||
@ -1872,6 +1872,14 @@
|
|||||||
_triggerEvent(plyr.media, 'timeupdate');
|
_triggerEvent(plyr.media, 'timeupdate');
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
|
// Check duration again due to YouTube bug
|
||||||
|
// https://github.com/Selz/plyr/issues/374
|
||||||
|
// https://code.google.com/p/gdata-issues/issues/detail?id=8690
|
||||||
|
if (plyr.media.duration !== instance.getDuration()) {
|
||||||
|
plyr.media.duration = instance.getDuration();
|
||||||
|
_triggerEvent(plyr.media, 'durationchange');
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
@ -3650,7 +3658,8 @@
|
|||||||
isMuted: function() { return plyr.media.muted; },
|
isMuted: function() { return plyr.media.muted; },
|
||||||
isReady: function() { return _hasClass(plyr.container, config.classes.ready); },
|
isReady: function() { return _hasClass(plyr.container, config.classes.ready); },
|
||||||
isLoading: function() { return _hasClass(plyr.container, config.classes.loading); },
|
isLoading: function() { return _hasClass(plyr.container, config.classes.loading); },
|
||||||
on: function(event, callback) { _on(plyr.container, event, callback); },
|
isPaused: function() { return plyr.media.paused; },
|
||||||
|
on: function(event, callback) { _on(plyr.container, event, callback); return this; },
|
||||||
play: _play,
|
play: _play,
|
||||||
pause: _pause,
|
pause: _pause,
|
||||||
stop: function() { _pause(); _seek(); },
|
stop: function() { _pause(); _seek(); },
|
||||||
|
@ -189,9 +189,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
// Cleaner radius, also forces iframe radius
|
|
||||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container for embeds
|
// Container for embeds
|
||||||
@ -200,6 +197,9 @@
|
|||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
// Require z-index to force border-radius
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -208,6 +208,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border: 0;
|
border: 0;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vimeo hack
|
// Vimeo hack
|
||||||
@ -259,11 +260,14 @@
|
|||||||
.plyr--captions-active .plyr__captions {
|
.plyr--captions-active .plyr__captions {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.plyr--hide-controls .plyr__captions {
|
||||||
|
transform: translateY(-(@plyr-control-spacing * 1.5));
|
||||||
|
}
|
||||||
|
// Large captions in full screen on larger screens
|
||||||
|
@media (min-width: @plyr-bp-screen-lg) {
|
||||||
.plyr--fullscreen-active .plyr__captions {
|
.plyr--fullscreen-active .plyr__captions {
|
||||||
font-size: @plyr-font-size-captions-large;
|
font-size: @plyr-font-size-captions-large;
|
||||||
}
|
}
|
||||||
.plyr--hide-controls .plyr__captions {
|
|
||||||
transform: translateY(-(@plyr-control-spacing * 1.5));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
|
@ -74,3 +74,4 @@
|
|||||||
// Breakpoints
|
// Breakpoints
|
||||||
@plyr-bp-screen-sm: 480px;
|
@plyr-bp-screen-sm: 480px;
|
||||||
@plyr-bp-screen-md: 768px;
|
@plyr-bp-screen-md: 768px;
|
||||||
|
@plyr-bp-screen-lg: 1024px;
|
@ -172,9 +172,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
// Cleaner radius, also forces iframe radius
|
|
||||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container for embeds
|
// Container for embeds
|
||||||
@ -184,6 +181,9 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: inherit;
|
border-radius: inherit;
|
||||||
|
|
||||||
|
// Require z-index to force border-radius
|
||||||
|
z-index: 0;
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -244,11 +244,14 @@
|
|||||||
.plyr--captions-active .plyr__captions {
|
.plyr--captions-active .plyr__captions {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.plyr--hide-controls .plyr__captions {
|
||||||
|
transform: translateY(-($plyr-control-spacing * 2));
|
||||||
|
}
|
||||||
|
// Large captions in full screen on larger screens
|
||||||
|
@media (min-width: $plyr-bp-screen-lg) {
|
||||||
.plyr--fullscreen-active .plyr__captions {
|
.plyr--fullscreen-active .plyr__captions {
|
||||||
font-size: $plyr-font-size-captions-large;
|
font-size: $plyr-font-size-captions-large;
|
||||||
}
|
}
|
||||||
.plyr--hide-controls .plyr__captions {
|
|
||||||
transform: translateY(-($plyr-control-spacing * 2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
|
@ -70,3 +70,4 @@ $plyr-range-selected-bg: $plyr-color-main !default;
|
|||||||
// Breakpoints
|
// Breakpoints
|
||||||
$plyr-bp-screen-sm: 480px !default;
|
$plyr-bp-screen-sm: 480px !default;
|
||||||
$plyr-bp-screen-md: 768px !default;
|
$plyr-bp-screen-md: 768px !default;
|
||||||
|
$plyr-bp-screen-lg: 1024px !default;
|
Loading…
x
Reference in New Issue
Block a user