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
|
||||
|
||||
## 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
|
||||
- Fixed `getCurrentTime()` method (fixes #351)
|
||||
- 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("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\\-]+)*)?",
|
||||
cdnpath = new RegExp(aws.cdn.bucket + "\/" + regex, "gi"),
|
||||
cdnpath = new RegExp(aws.cdn.domain + "\/" + regex, "gi"),
|
||||
semver = new RegExp("v" + regex, "gi"),
|
||||
localPath = new RegExp("(\.\.\/)?dist", "gi"),
|
||||
versionPath = "https://" + aws.cdn.bucket + "/" + version;
|
||||
versionPath = "https://" + aws.cdn.domain + "/" + version;
|
||||
}
|
||||
|
||||
// Publish version to CDN bucket
|
||||
gulp.task("cdn", function () {
|
||||
console.log("Uploading " + version + " to " + aws.cdn.bucket + "...");
|
||||
console.log("Uploading " + version + " to " + aws.cdn.domain + "...");
|
||||
|
||||
// Upload to CDN
|
||||
return gulp.src(paths.upload)
|
||||
@ -270,17 +270,17 @@ gulp.task("cdn", function () {
|
||||
|
||||
// Publish to demo bucket
|
||||
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
|
||||
gulp.src([root + "/readme.md"])
|
||||
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||
.pipe(replace(cdnpath, aws.cdn.domain + "/" + version))
|
||||
.pipe(gulp.dest(root));
|
||||
|
||||
// Replace versioned files in plyr.js
|
||||
gulp.src(path.join(root, "src/js/plyr.js"))
|
||||
.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/")));
|
||||
|
||||
// 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
|
||||
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
|
||||
// Doesn't matter which file since we set the URL above
|
||||
// Weird, I know...
|
||||
return gulp.src([paths.demo.root + "index.html"])
|
||||
.pipe(open("", {
|
||||
url: "http://" + aws.demo.bucket
|
||||
url: "http://" + aws.demo.domain
|
||||
}));
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.9",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "http://plyr.io",
|
||||
"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:
|
||||
|
||||
```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
|
||||
@ -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.7/plyr.css">
|
||||
<link rel="stylesheet" href="https://cdn.plyr.io/2.0.9/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.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
|
||||
|
||||
@ -498,7 +498,7 @@ Here's a list of the methods supported:
|
||||
<tr>
|
||||
<td><code>on()</code></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>
|
||||
<td><code>play()</code></td>
|
||||
@ -565,6 +565,11 @@ Here's a list of the methods supported:
|
||||
<td>Boolean</td>
|
||||
<td>Toggles playback for the player based on either the boolean argument or it's current state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>isPaused()</code></td>
|
||||
<td>—</td>
|
||||
<td>Will return a boolean for whether the media is currently paused.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>toggleMute()</code></td>
|
||||
<td>—</td>
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ==========================================================================
|
||||
// Plyr
|
||||
// plyr.js v2.0.7
|
||||
// plyr.js v2.0.9
|
||||
// https://github.com/selz/plyr
|
||||
// License: The MIT License (MIT)
|
||||
// ==========================================================================
|
||||
@ -45,7 +45,7 @@
|
||||
displayDuration: true,
|
||||
loadSprite: true,
|
||||
iconPrefix: 'plyr',
|
||||
iconUrl: 'https://cdn.plyr.io/2.0.7/plyr.svg',
|
||||
iconUrl: 'https://cdn.plyr.io/2.0.9/plyr.svg',
|
||||
clickToPlay: true,
|
||||
hideControls: true,
|
||||
showPosterOnEnd: false,
|
||||
@ -1872,6 +1872,14 @@
|
||||
_triggerEvent(plyr.media, 'timeupdate');
|
||||
}, 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;
|
||||
|
||||
case 2:
|
||||
@ -3650,7 +3658,8 @@
|
||||
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); },
|
||||
isPaused: function() { return plyr.media.paused; },
|
||||
on: function(event, callback) { _on(plyr.container, event, callback); return this; },
|
||||
play: _play,
|
||||
pause: _pause,
|
||||
stop: function() { _pause(); _seek(); },
|
||||
|
@ -189,9 +189,6 @@
|
||||
position: relative;
|
||||
background: #000;
|
||||
border-radius: inherit;
|
||||
|
||||
// Cleaner radius, also forces iframe radius
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
|
||||
// Container for embeds
|
||||
@ -200,6 +197,9 @@
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
|
||||
// Require z-index to force border-radius
|
||||
z-index: 0;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -208,6 +208,7 @@
|
||||
height: 100%;
|
||||
border: 0;
|
||||
user-select: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
// Vimeo hack
|
||||
@ -259,12 +260,15 @@
|
||||
.plyr--captions-active .plyr__captions {
|
||||
display: block;
|
||||
}
|
||||
.plyr--fullscreen-active .plyr__captions {
|
||||
font-size: @plyr-font-size-captions-large;
|
||||
}
|
||||
.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 {
|
||||
font-size: @plyr-font-size-captions-large;
|
||||
}
|
||||
}
|
||||
|
||||
// Controls
|
||||
// --------------------------------------------------------------
|
||||
|
@ -74,3 +74,4 @@
|
||||
// Breakpoints
|
||||
@plyr-bp-screen-sm: 480px;
|
||||
@plyr-bp-screen-md: 768px;
|
||||
@plyr-bp-screen-lg: 1024px;
|
@ -172,9 +172,6 @@
|
||||
position: relative;
|
||||
background: #000;
|
||||
border-radius: inherit;
|
||||
|
||||
// Cleaner radius, also forces iframe radius
|
||||
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
|
||||
}
|
||||
|
||||
// Container for embeds
|
||||
@ -184,6 +181,9 @@
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
|
||||
// Require z-index to force border-radius
|
||||
z-index: 0;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -244,12 +244,15 @@
|
||||
.plyr--captions-active .plyr__captions {
|
||||
display: block;
|
||||
}
|
||||
.plyr--fullscreen-active .plyr__captions {
|
||||
font-size: $plyr-font-size-captions-large;
|
||||
}
|
||||
.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 {
|
||||
font-size: $plyr-font-size-captions-large;
|
||||
}
|
||||
}
|
||||
|
||||
// Controls
|
||||
// --------------------------------------------------------------
|
||||
|
@ -70,3 +70,4 @@ $plyr-range-selected-bg: $plyr-color-main !default;
|
||||
// Breakpoints
|
||||
$plyr-bp-screen-sm: 480px !default;
|
||||
$plyr-bp-screen-md: 768px !default;
|
||||
$plyr-bp-screen-lg: 1024px !default;
|
Loading…
x
Reference in New Issue
Block a user