Bug fixes for controls changes
This commit is contained in:
parent
e568bc9c8d
commit
7c5f38311b
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## v1.1.1
|
||||
- Fix for unsupported browser handling
|
||||
- Fix for config.controls having no effect
|
||||
|
||||
## v1.1.0
|
||||
- Added config option to set which controls are shown (if using the default controls html) and better handling of missing controls
|
||||
|
||||
|
2
dist/plyr.js
vendored
2
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.0/docs.css">
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.1/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
|
@ -8,10 +8,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.0/plyr.css">
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.1/plyr.css">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.0/docs.css">
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.1/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
@ -83,13 +83,13 @@
|
||||
b.insertBefore(c, b.childNodes[0]);
|
||||
}
|
||||
}
|
||||
})(document, "https://cdn.plyr.io/1.1.0/sprite.svg");
|
||||
})(document, "https://cdn.plyr.io/1.1.1/sprite.svg");
|
||||
</script>
|
||||
|
||||
<!-- Plyr core script -->
|
||||
<script src="//cdn.plyr.io/1.1.0/plyr.js"></script>
|
||||
<script src="//cdn.plyr.io/1.1.1/plyr.js"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<script src="//cdn.plyr.io/1.1.0/docs.js"></script>
|
||||
<script src="//cdn.plyr.io/1.1.1/docs.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "A simple HTML5 media player using custom controls",
|
||||
"homepage": "http://plyr.io",
|
||||
"main": "gulpfile.js",
|
||||
|
@ -38,7 +38,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.1.0/plyr.js` to `https://cdn.plyr.io/1.1.0/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.1.1/plyr.js` to `https://cdn.plyr.io/1.1.1/plyr.js`
|
||||
|
||||
### Bower
|
||||
If bower is your thang, you can grab Plyr using:
|
||||
@ -51,11 +51,11 @@ More info on setting up dependencies can be found in the [Bower Docs](http://bow
|
||||
If you want to use our CDN, you can use the following. HTTPS (SSL) is supported.
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.0/plyr.css">
|
||||
<script src="//cdn.plyr.io/1.1.0/plyr.js"></script>
|
||||
<link rel="stylesheet" href="//cdn.plyr.io/1.1.1/plyr.css">
|
||||
<script src="//cdn.plyr.io/1.1.1/plyr.js"></script>
|
||||
```
|
||||
|
||||
You can also access the `sprite.svg` file at `//cdn.plyr.io/1.1.0/sprite.svg`.
|
||||
You can also access the `sprite.svg` file at `//cdn.plyr.io/1.1.1/sprite.svg`.
|
||||
|
||||
### CSS
|
||||
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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// ==========================================================================
|
||||
// Plyr
|
||||
// plyr.js v1.1.0
|
||||
// plyr.js v1.1.1
|
||||
// https://github.com/selz/plyr
|
||||
// License: The MIT License (MIT)
|
||||
// ==========================================================================
|
||||
@ -84,7 +84,7 @@
|
||||
};
|
||||
|
||||
// Build the default HTML
|
||||
defaults.html = (function() {
|
||||
function _buildControls() {
|
||||
// Open and add the progress and seek elements
|
||||
var html = [
|
||||
"<div class='player-controls'>",
|
||||
@ -101,7 +101,7 @@
|
||||
"<span class='player-controls-left'>"];
|
||||
|
||||
// Restart button
|
||||
if(_inArray(defaults.controls, "restart")) {
|
||||
if(_inArray(config.controls, "restart")) {
|
||||
html.push(
|
||||
"<button type='button' data-player='restart'>",
|
||||
"<svg><use xlink:href='#icon-restart'></use></svg>",
|
||||
@ -111,7 +111,7 @@
|
||||
}
|
||||
|
||||
// Rewind button
|
||||
if(_inArray(defaults.controls, "rewind")) {
|
||||
if(_inArray(config.controls, "rewind")) {
|
||||
html.push(
|
||||
"<button type='button' data-player='rewind'>",
|
||||
"<svg><use xlink:href='#icon-rewind'></use></svg>",
|
||||
@ -121,7 +121,7 @@
|
||||
}
|
||||
|
||||
// Play/pause button
|
||||
if(_inArray(defaults.controls, "play")) {
|
||||
if(_inArray(config.controls, "play")) {
|
||||
html.push(
|
||||
"<button type='button' data-player='play'>",
|
||||
"<svg><use xlink:href='#icon-play'></use></svg>",
|
||||
@ -135,7 +135,7 @@
|
||||
}
|
||||
|
||||
// Fast forward button
|
||||
if(_inArray(defaults.controls, "fast-forward")) {
|
||||
if(_inArray(config.controls, "fast-forward")) {
|
||||
html.push(
|
||||
"<button type='button' data-player='fast-forward'>",
|
||||
"<svg><use xlink:href='#icon-fast-forward'></use></svg>",
|
||||
@ -145,7 +145,7 @@
|
||||
}
|
||||
|
||||
// Media current time display
|
||||
if(_inArray(defaults.controls, "current-time")) {
|
||||
if(_inArray(config.controls, "current-time")) {
|
||||
html.push(
|
||||
"<span class='player-time'>",
|
||||
"<span class='sr-only'>Current time</span>",
|
||||
@ -155,7 +155,7 @@
|
||||
}
|
||||
|
||||
// Media duration display
|
||||
if(_inArray(defaults.controls, "duration")) {
|
||||
if(_inArray(config.controls, "duration")) {
|
||||
html.push(
|
||||
"<span class='player-time'>",
|
||||
"<span class='sr-only'>Duration</span>",
|
||||
@ -171,7 +171,7 @@
|
||||
);
|
||||
|
||||
// Toggle mute button
|
||||
if(_inArray(defaults.controls, "mute")) {
|
||||
if(_inArray(config.controls, "mute")) {
|
||||
html.push(
|
||||
"<input class='inverted sr-only' id='mute{id}' type='checkbox' data-player='mute'>",
|
||||
"<label id='mute{id}' for='mute{id}'>",
|
||||
@ -183,7 +183,7 @@
|
||||
}
|
||||
|
||||
// Volume range control
|
||||
if(_inArray(defaults.controls, "volume")) {
|
||||
if(_inArray(config.controls, "volume")) {
|
||||
html.push(
|
||||
"<label for='volume{id}' class='sr-only'>Volume</label>",
|
||||
"<input id='volume{id}' class='player-volume' type='range' min='0' max='10' value='5' data-player='volume'>"
|
||||
@ -191,7 +191,7 @@
|
||||
}
|
||||
|
||||
// Toggle captions button
|
||||
if(_inArray(defaults.controls, "captions")) {
|
||||
if(_inArray(config.controls, "captions")) {
|
||||
html.push(
|
||||
"<input class='sr-only' id='captions{id}' type='checkbox' data-player='captions'>",
|
||||
"<label for='captions{id}'>",
|
||||
@ -203,7 +203,7 @@
|
||||
}
|
||||
|
||||
// Toggle fullscreen button
|
||||
if(_inArray(defaults.controls, "fullscreen")) {
|
||||
if(_inArray(config.controls, "fullscreen")) {
|
||||
html.push(
|
||||
"<button type='button' data-player='fullscreen'>",
|
||||
"<svg class='icon-exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>",
|
||||
@ -220,7 +220,7 @@
|
||||
);
|
||||
|
||||
return html.join("");
|
||||
})();
|
||||
}
|
||||
|
||||
// Debugging
|
||||
function _log(text, error) {
|
||||
@ -330,7 +330,7 @@
|
||||
|
||||
// Element exists in an array
|
||||
function _inArray(haystack, needle) {
|
||||
return (haystack.indexOf(needle) != -1);
|
||||
return Array.prototype.indexOf && (haystack.indexOf(needle) != -1);
|
||||
}
|
||||
|
||||
// Replace all
|
||||
@ -684,9 +684,9 @@
|
||||
// Insert custom video controls
|
||||
_log("Injecting custom controls.");
|
||||
|
||||
// If no controls are specified, bail
|
||||
// If no controls are specified, create default
|
||||
if(!config.html) {
|
||||
return;
|
||||
config.html = _buildControls();
|
||||
}
|
||||
|
||||
// Replace seek time instances
|
||||
@ -1624,7 +1624,7 @@
|
||||
// Extend the default options with user specified
|
||||
config = _extend(defaults, options);
|
||||
|
||||
// If enabled carry on
|
||||
// Bail if disabled or no basic support
|
||||
// You may want to disable certain UAs etc
|
||||
if(!config.enabled || !api.supported().basic) {
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user