Minor tweaks

This commit is contained in:
Sam Potts 2015-02-28 01:17:56 +11:00
parent 1d2bd227f1
commit 1216968c60
5 changed files with 20 additions and 22 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "plyr", "name": "plyr",
"version": "1.0.12", "version": "1.0.13",
"description": "A simple HTML5 media player using custom controls", "description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io", "homepage": "http://plyr.io",
"keywords": [ "keywords": [

View File

@ -1,5 +1,8 @@
# Changelog # Changelog
## v1.0.13
- Minor tweaks
## v1.0.12 ## v1.0.12
- Handle native events (Issue #34) - Handle native events (Issue #34)

2
dist/js/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "plyr", "name": "plyr",
"version": "1.0.12", "version": "1.0.13",
"description": "A simple HTML5 media player using custom controls", "description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io", "homepage": "http://plyr.io",
"main": "gulpfile.js", "main": "gulpfile.js",

View File

@ -1,6 +1,6 @@
// ========================================================================== // ==========================================================================
// Plyr // Plyr
// plyr.js v1.0.11 // plyr.js v1.0.13
// https://github.com/sampotts/plyr // https://github.com/sampotts/plyr
// ========================================================================== // ==========================================================================
// Credits: http://paypal.github.io/accessible-html5-video-player/ // Credits: http://paypal.github.io/accessible-html5-video-player/
@ -713,12 +713,6 @@
player.media.pause(); player.media.pause();
} }
// Check playing state
function _checkPlaying() {
_toggleClass(player.container, config.classes.playing, !player.media.paused);
_toggleClass(player.container, config.classes.stopped, player.media.paused);
}
// Restart playback // Restart playback
function _restart() { function _restart() {
// Move to beginning // Move to beginning
@ -736,7 +730,7 @@
// Rewind // Rewind
function _rewind(seekInterval) { function _rewind(seekInterval) {
// Use default if needed // Use default if needed
if(typeof seekInterval === "undefined") { if(typeof seekInterval !== "number") {
seekInterval = config.seekInterval; seekInterval = config.seekInterval;
} }
@ -757,7 +751,7 @@
// Fast forward // Fast forward
function _forward(seekInterval) { function _forward(seekInterval) {
// Use default if needed // Use default if needed
if(typeof seekInterval === "undefined") { if(typeof seekInterval !== "number") {
seekInterval = config.seekInterval; seekInterval = config.seekInterval;
} }
@ -775,6 +769,12 @@
} }
} }
// Check playing state
function _checkPlaying() {
_toggleClass(player.container, config.classes.playing, !player.media.paused);
_toggleClass(player.container, config.classes.stopped, player.media.paused);
}
// Toggle fullscreen // Toggle fullscreen
function _toggleFullscreen() { function _toggleFullscreen() {
// Check for native support // Check for native support
@ -937,27 +937,23 @@
// Play // Play
_on(player.buttons.play, "click", function() { _on(player.buttons.play, "click", function() {
_play(); _play();
player.buttons.pause.focus(); setTimeout(function() { player.buttons.pause.focus(); }, 100);
}); });
// Pause // Pause
_on(player.buttons.pause, "click", function() { _on(player.buttons.pause, "click", function() {
_pause(); _pause();
player.buttons.play.focus(); setTimeout(function() { player.buttons.play.focus(); }, 100);
}); });
// Restart // Restart
_on(player.buttons.restart, "click", _restart); _on(player.buttons.restart, "click", _restart);
// Rewind // Rewind
_on(player.buttons.rewind, "click", function() { _on(player.buttons.rewind, "click", _rewind);
_rewind(config.seekInterval);
});
// Fast forward // Fast forward
_on(player.buttons.forward, "click", function() { _on(player.buttons.forward, "click", _forward);
_forward(config.seekInterval);
});
// Get the HTML5 range input element and append audio volume adjustment on change // Get the HTML5 range input element and append audio volume adjustment on change
_on(player.volume, "change", function() { _on(player.volume, "change", function() {
@ -1017,8 +1013,7 @@
if(player.type === "video") { if(player.type === "video") {
player.captionsContainer.innerHTML = ""; player.captionsContainer.innerHTML = "";
} }
_toggleClass(player.container, config.classes.stopped, true); _checkPlaying();
_toggleClass(player.container, config.classes.playing);
}); });
// Check for buffer progress // Check for buffer progress