[FIX] mail: fix crash when trying to catch result of play()

Some browsers don't return a promise from mediaElement.play(), we wrap
it in promise.resolve to solve the issue.

closes odoo/odoo#77368

X-original-commit: 50898870067d05fb01722487dc2d63a1a5155c7d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Samuel Degueldre
2021-09-28 21:02:23 +00:00
parent 21e9088839
commit 347756909a
@@ -30,7 +30,7 @@ function factory(dependencies) {
this.audio.currentTime = 0;
this.audio.loop = loop;
this.audio.volume = volume;
this.audio.play().catch(()=>{});
Promise.resolve(this.audio.play()).catch(()=>{});
}
/**