How in include a AEM dynamic media component into another component
Hi All,
When I tried to include OOTB dynamic media component as part of my component it is throwing exception and it is not allowing me to do so.I have tried like
<section data-sly-resource="${ 'dynamic-media' @ resourceType='dam/components/scene7/dynamicmedia'}"/>
After drag and drop the customComponent(where I have included as above) and view as published mode it is throwing error.
Error:
28.02.2019 13:13:23.803 *ERROR* [0:0:0:0:0:0:0:1 [1551320003725] GET /content/we-retail/dynamic-media2.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
org.apache.sling.scripting.sightly.SightlyException: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "replace" of undefined (/libs/dam/components/scene7/dynamicmedia/dynamicmedia_sly.js#470)
Can anyone help me to resolve this issue? How to include OOTB dynamic media component into custom component and how to send parameter to that (i.e Asset path or something) in order to render the dynamic media image on my component.