I have a list of video results displaying in a paper-card
element, using an HTML5 video
-tag without the controls
attribute, so the video only shows the first frame. To view the video there is an action to open the video in a paper-dialog
(modal).
In the collection view, it works as expected.
When the dialog is launched, it simply displays the controls only in Chrome, and in Firefox it shows the controls with the message No video with supported format and MIME type found
.
The video
-element's src
-attribute is populated, and the source definitely exists.
This is awkward as the video shows fine inside the collection view, but in the modal it is not functional.
It turns out that the issue is with the instant the
video
-tag is realised and rendered.The dialog is shared and the video item is populated on demand.
This causes the
video
-element to report an error because<source src="...">
is not populated at first. Simply usingsrc$="..."
was not enough.Instead it works by wrapping the
video
-element in adom-if
template like so: