+ Start a Discussion
Akhil Katkam 5Akhil Katkam 5 

Based on url field display video in component

Hi Developer Community , i have a url field called  youtube_video __c,

in this field i will keep embedded youtube link , and how can i use this field in  aura component for displaying video based on the url field ?

can anyone please help me with the solution or code

Thanks in Advance
Best Answer chosen by Akhil Katkam 5
mukesh guptamukesh gupta
Hi Akhil,

Please follow below code
 
<aura:component>
 
  <iframe width="720" height="480" src="{!v.youtube_video __c}"></iframe>
 
</aura:component>
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 

 

All Answers

Surya GSurya G
Hi Akhil, 
Get the field value in aura component and set it in an attribute, and use iframe tag in component file  to play the video in page.
Let say, fieldUrl is the attribute that holds the field value,

<iframe width="420" height="345" src="{fieldUrl}">
</iframe>

Thanks
Surya G
mukesh guptamukesh gupta
Hi Akhil,

Please follow below code
 
<aura:component>
 
  <iframe width="720" height="480" src="{!v.youtube_video __c}"></iframe>
 
</aura:component>
if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh 

 
This was selected as the best answer
Akhil Katkam 5Akhil Katkam 5
Thanks mukesh gupta , i got it