aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-20 10:48:28 +1100
committerSam Potts <me@sampotts.me>2017-11-20 10:48:28 +1100
commitfeae00224e90c42228fb76e5b3d3075ab0532b3b (patch)
tree157763d5eebfa84e2cc89fb1cc01fde042ff940f /src/js/plyr.js
parentdc391c98c6c77479b994dbe7ee00093e1684eea4 (diff)
downloadplyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.tar.lz
plyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.tar.xz
plyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.zip
Added ended and playing getters
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index af9d57bf..4f985a31 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -283,6 +283,14 @@ class Plyr {
return this.media.paused;
}
+ get playing() {
+ return this.currentTime > 0 && !this.paused && !this.ended && (this.isHTML5 ? this.media.readyState > 2 : true);
+ }
+
+ get ended() {
+ return this.media.ended;
+ }
+
/**
* Toggle playback based on current status
* @param {boolean} toggle