From 4a34dab79023a626bb7643c120aeb9c410384d58 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 14 Jun 2021 08:56:44 +0200 Subject: [PATCH] MOBILE-3320 ios: Fix video posters not displayed sometimes --- src/core/directives/external-content.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/directives/external-content.ts b/src/core/directives/external-content.ts index e8a6975d8..7bda6336e 100644 --- a/src/core/directives/external-content.ts +++ b/src/core/directives/external-content.ts @@ -277,6 +277,13 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges { this.loaded = false; this.waitForLoad(); } + + if (targetAttr == 'poster') { + // Setting the poster immediately doesn't display it in some cases. Set it to empty and then set the right one. + this.element.setAttribute(targetAttr, ''); + await CoreUtils.nextTick(); + } + this.element.setAttribute(targetAttr, finalUrl); this.element.setAttribute('data-original-' + targetAttr, url); }