repo: janusweb action: commit revision: path_from: revision_from: 592c3f31b55d2db2ea30b56081c1712a39b254c7: path_to: revision_to:
commit 592c3f31b55d2db2ea30b56081c1712a39b254c7 Author: James BaicoianuDate: 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
--- 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-----