Fix for promise issue on Chrome, loading fix
This commit is contained in:
parent
965fc0b2f5
commit
6b9106ddb1
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,4 +4,5 @@ aws.json
|
|||||||
*.mp4
|
*.mp4
|
||||||
!dist/blank.mp4
|
!dist/blank.mp4
|
||||||
index-*.html
|
index-*.html
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
*.webm
|
||||||
|
2
demo/dist/demo.css
vendored
2
demo/dist/demo.css
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.js
vendored
2
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.js.map
vendored
2
dist/plyr.js.map
vendored
File diff suppressed because one or more lines are too long
@ -283,7 +283,11 @@ class Plyr {
|
|||||||
* Pause the media
|
* Pause the media
|
||||||
*/
|
*/
|
||||||
pause() {
|
pause() {
|
||||||
return this.media.pause();
|
if (!this.playing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.media.pause();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -309,11 +313,13 @@ class Plyr {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle playback based on current status
|
* Toggle playback based on current status
|
||||||
* @param {boolean} toggle
|
* @param {boolean} input
|
||||||
*/
|
*/
|
||||||
togglePlay(toggle) {
|
togglePlay(input) {
|
||||||
// True toggle if nothing passed
|
// Toggle based on current state if nothing passed
|
||||||
if ((!utils.is.boolean(toggle) && this.media.paused) || toggle) {
|
const toggle = utils.is.boolean(input) ? input : !this.playing;
|
||||||
|
|
||||||
|
if (toggle) {
|
||||||
this.play();
|
this.play();
|
||||||
} else {
|
} else {
|
||||||
this.pause();
|
this.pause();
|
||||||
|
@ -2,7 +2,10 @@
|
|||||||
// Progress
|
// Progress
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Loading
|
||||||
$plyr-progress-loading-size: 25px !default;
|
$plyr-progress-loading-size: 25px !default;
|
||||||
$plyr-progress-loading-bg: rgba($plyr-color-gunmetal, 0.2) !default;
|
$plyr-progress-loading-bg: rgba($plyr-color-gunmetal, 0.6) !default;
|
||||||
|
|
||||||
|
// Buffered
|
||||||
$plyr-video-progress-buffered-bg: rgba(#fff, 0.25) !default;
|
$plyr-video-progress-buffered-bg: rgba(#fff, 0.25) !default;
|
||||||
$plyr-audio-progress-buffered-bg: rgba($plyr-color-heather, 0.66) !default;
|
$plyr-audio-progress-buffered-bg: rgba($plyr-color-heather, 0.66) !default;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user