From 9d60a382caec7aee87b82ea523b7e9269f4c28ec Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Tue, 27 Feb 2018 00:33:52 -0500 Subject: [PATCH] Added a current time and duration of the video --- src/coffee/player.coffee | 58 ++++++++++++++++++++++++++++++++-------- src/sass/mup.sass | 40 ++++++++++++++++----------- 2 files changed, 72 insertions(+), 26 deletions(-) diff --git a/src/coffee/player.coffee b/src/coffee/player.coffee index 61b62d2..539bb32 100644 --- a/src/coffee/player.coffee +++ b/src/coffee/player.coffee @@ -29,6 +29,9 @@ # create the video player createPlayer(wrapperElem) + + # load the video now + videoElem.get(0).load() # end setup function return @@ -64,6 +67,7 @@ class: settings.class_prefix + 'video') videoElem.on('ended', resetVideo) videoElem.on('timeupdate', updateProgress) + videoElem.on('loadedmetadata', updateDuration) # loop through the video sources for source in settings.video_sources @@ -79,15 +83,6 @@ class: settings.class_prefix + 'controls') # create control elements - playButton = $('