Answer the question
In order to leave comments, you need to log in
How to reformat a link from YouTube?
when creating a section element, there is a field for entering a link to a YouTube video, I get it from <?= $arResult['PROPERTIES']['VIDEO']['VALUE'] ?> how to reformat the link for an iframe? That is, we insert into the input
https://www.youtube.com/watch?v=nXbCcaoVMCQ
and into the iframe itself we gethttps://www.youtube.com/embed/nXbCcaoVMCQ
<iframe class="media__iframe"
src="<?= $arResult['PROPERTIES']['VIDEO']['VALUE'] ?>"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
Answer the question
In order to leave comments, you need to log in
google regular expressions to pull id from youtube video. for example https://stackoverflow.com/questions/6903823/regex-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question