From 4c1f39832269710ed7e4b5ebdb110c7458697c9c Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 16 Aug 2021 13:48:10 +0200 Subject: [PATCH] Fix volume and playbackrate for both youtube and html video --- api/js/etemplate/et2_widget_video.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/et2_widget_video.ts b/api/js/etemplate/et2_widget_video.ts index ed3bfef127..9a5853ee09 100644 --- a/api/js/etemplate/et2_widget_video.ts +++ b/api/js/etemplate/et2_widget_video.ts @@ -285,9 +285,9 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode let value = _value>100?100:_value; if (value>= 0) { - if (this._isYoutube()) + if (this._isYoutube() && this.youtube) { - this.youtube.set_volume(value); + this.youtube.setVolume(value); } else { @@ -301,13 +301,13 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode */ get_volume() { - if (this._isYoutube()) + if (this._isYoutube() && this.youtube) { - return this.youtube.get_playBackRate(); + return this.youtube.getVolume(); } else { - return this.video[0].playBackRate; + return this.video[0].volume; } } @@ -320,13 +320,13 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode let value = _value>16?16:_value; if (value>= 0) { - if (this._isYoutube()) + if (this._isYoutube() && this.youtube) { - this.youtube.playBackRate(value); + this.youtube.setPlaybackRate(value); } else { - this.video[0].playBackRate = value; + this.video[0].playbackRate = value; } } } @@ -336,13 +336,13 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode */ get_playBackRate() { - if (this._isYoutube()) + if (this._isYoutube() && this.youtube) { - return this.youtube.get_volume(); + return this.youtube.getPlaybackRate(); } else { - return this.video[0].volume; + return this.video[0].playbackRate; } }