allow to use image spec like "api/mime128_video" for poster like for regular images

This commit is contained in:
Ralf Becker 2020-05-08 12:20:37 +02:00
parent c299c82e09
commit 1d6033fb4e
2 changed files with 9 additions and 2 deletions

View File

@ -124,10 +124,13 @@ var et2_video = /** @class */ (function (_super) {
* Set poster attribute in order to specify
* an image to be shown while video is loading or before user play it
*
* @param {string} _url
* @param {string} _url url or image spec like "api/mime128_video"
*/
et2_video.prototype.set_poster = function (_url) {
if (_url) {
if (_url[0] !== '/' && !_url.match(/^https?:\/\//)) {
_url = this.egw().image(_url);
}
this.video.attr("poster", _url);
}
};

View File

@ -176,12 +176,16 @@ export class et2_video extends et2_baseWidget implements et2_IDOMNode
* Set poster attribute in order to specify
* an image to be shown while video is loading or before user play it
*
* @param {string} _url
* @param {string} _url url or image spec like "api/mime128_video"
*/
set_poster(_url: string)
{
if (_url)
{
if (_url[0] !== '/' && !_url.match(/^https?:\/\//))
{
_url = this.egw().image(_url);
}
this.video.attr("poster", _url);
}
}