Add getter/setter for video's mute option and fix volume unit

This commit is contained in:
Hadi Nategh 2021-08-16 17:49:47 +02:00
parent 677e11df1c
commit 904e6a96e1

View File

@ -307,7 +307,7 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
} }
else else
{ {
return this.video[0].volume; return this.video[0].volume * 100;
} }
} }
@ -346,6 +346,35 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
} }
} }
set_mute(_value)
{
if (this._isYoutube() && this.youtube) {
if (_value)
{
this.youtube.mute();
}
else
{
this.youtube.unMute();
}
}
else
{
this.video[0].muted = _value;
}
}
get_mute(_value)
{
if (this._isYoutube() && this.youtube)
{
return this.youtube.isMuted();
}
else
{
return this.video[0].muted;
}
}
/** /**
* Set poster attribute in order to specify * Set poster attribute in order to specify
* an image to be shown while video is loading or before user play it * an image to be shown while video is loading or before user play it