repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 592c3f31b55d2db2ea30b56081c1712a39b254c7:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 592c3f31b55d2db2ea30b56081c1712a39b254c7
Author: James Baicoianu 
Date:   Tue Aug 8 03:30:26 2017 -0700

    Added video.seek() video.current_time and video.total_time

diff --git a/scripts/video.js b/scripts/video.js
index d763ca7cb2582e7b88a41957380078c163f1544b..
index ..f5528bab46bc77953d606b3fff54bcc596dfbfbf 100644
--- a/scripts/video.js
+++ b/scripts/video.js
@@ -153,17 +153,35 @@ elation.require(['janusweb.janusbase'], function() {
         this.video.src = '';
       }
     }
+    this.seek = function(time) {
+      if (this.video) this.video.currentTime = time;
+    }
+    this.getCurrentTime = function() {
+      if (this.video) {
+        return this.video.currentTime;
+      }
+      return 0;
+    }
+    this.getTotalTime = function() {
+      if (this.video) {
+        return this.video.duration;
+      }
+      return 0;
+    }
     this.getProxyObject = function(classdef) {
       var proxy = elation.engine.things.janusvideo.extendclass.getProxyObject.call(this, classdef);
       proxy._proxydefs = {
         loop:    [ 'property', 'loop'],
         video:   [ 'property', 'video'],
         gain:    [ 'property', 'gain'],
+        current_time: [ 'accessor', 'getCurrentTime'],
+        total_time: [ 'accessor', 'getTotalTime'],

         isPlaying: [ 'function', 'isPlaying'],
         play:    [ 'function', 'play'],
         pause:   [ 'function', 'pause'],
         toggle:  [ 'function', 'togglePlay'],
+        seek:    [ 'function', 'seek'],
       };
       return proxy;
     }

-----END OF PAGE-----