Closed ediamin closed 2 years ago
@westonruter I would like to know your opinion about the boilerplate error. Should I remove the error for amp-audio or keep it as it is?
I would like to know your opinion about the boilerplate error. Should I remove the error for amp-audio or keep it as it is?
I'm not sure I understand. As I understand, there still should be an error raised for amp-audio
if it lacks a child <audio controls style="width:100%;"></audio>
, correct?
Oh I see. You're adding it if it isn't present originally. In that case, no, the error probably isn't necessary.
Sorry for the confusion. I would like to know your opinion about these two lines. Should I remove them or keep them as it?
$errors->add(Error\CannotRemoveBoilerplate::fromAmpAudio($ampElement));
$canRemoveBoilerplate = false;
I would like to know your opinion about these two lines. Should I remove them or keep them as it?
It seems to me that they can be removed, no? I don't see any reason why the error would be needed if we can always SSR the amp-audio
.
It seems to me that they can be removed, no? I don't see any reason why the error would be needed if we can always SSR the amp-audio.
I'm not sure about that. The comment says, amp-audio requires knowing the dimensions of the browser. Do not remove the boilerplate or apply layout
and it is the same in the amp-toolbox node repo.
What I mean is that if amp-toolbox-php is always adding the audio
child to enable SSR, then there would never be a scenario where the presence of amp-audio
would cause any error for SSR. So would the error message ever be correct?
I've updated the code and removed the error for amp-audio.
Fixes #518
This PR adds the SSR support for amp-audio extension. It simply adds
<audio controls></audio>
element if amp-audio extension is present.