From bbd9a5a76555bd99f7e1bd78fc44aa4d4b11fd4f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 2 Feb 2021 12:02:26 +0200 Subject: [PATCH] allow to set starttime of video --- api/js/etemplate/et2_widget_video.js | 12 +++++++++++- api/js/etemplate/et2_widget_video.ts | 13 ++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_widget_video.js b/api/js/etemplate/et2_widget_video.js index af92f71c94..24f0989a10 100644 --- a/api/js/etemplate/et2_widget_video.js +++ b/api/js/etemplate/et2_widget_video.js @@ -24,6 +24,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +exports.et2_video = void 0; /*egw:uses /vendor/bower-asset/jquery/dist/jquery.js; et2_core_interfaces; @@ -97,6 +98,9 @@ var et2_video = /** @class */ (function (_super) { if (this.options.src_type) { source.attr('type', this.options.src_type); } + if (this.options.starttime) { + this.seek_video(this.options.starttime); + } } }; /** @@ -178,11 +182,17 @@ var et2_video = /** @class */ (function (_super) { "description": "Defines that the audio output of the video should be muted" }, "autoplay": { - "name": "Autoply", + "name": "Autoplay", "type": "boolean", "default": false, "description": "Defines if Video will start playing as soon as it is ready" }, + starttime: { + "name": "Inital position of video", + "type": "float", + "default": 0, + "description": "Set initial position of video" + }, "controls": { "name": "Control buttons", "type": "boolean", diff --git a/api/js/etemplate/et2_widget_video.ts b/api/js/etemplate/et2_widget_video.ts index e63a2b5ea3..c60b4fb0ba 100644 --- a/api/js/etemplate/et2_widget_video.ts +++ b/api/js/etemplate/et2_widget_video.ts @@ -69,11 +69,17 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode "description": "Defines that the audio output of the video should be muted" }, "autoplay": { - "name": "Autoply", + "name": "Autoplay", "type": "boolean", "default": false, "description": "Defines if Video will start playing as soon as it is ready" }, + starttime: { + "name": "Inital position of video", + "type": "float", + "default": 0, + "description": "Set initial position of video" + }, "controls": { "name": "Control buttons", "type": "boolean", @@ -142,6 +148,11 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode { source.attr('type', this.options.src_type); } + + if (this.options.starttime) + { + this.seek_video(this.options.starttime); + } } }