AnsweredAssumed Answered

Modify Popup Template for Video from url in attribute table

Question asked by rcostley_CPYInc on Jan 25, 2017
Latest reply on Jan 25, 2017 by rscheitlin

I am trying to modify the code found at https://community.esri.com/thread/121245 to use a text field from the attribute table of the layer for the URL of the video. I am new to Javascript, so I'm struggling. I need to change line 7 so that the src is text from my attribute table. thx...

 

  1.  var template  = new PopupTemplate();  
  2.         template.setTitle("<b>City</b>");  
  3.         template.setContent(getContent); //this will call the getContent function where you can custom build your fields and add video  
  4.       
  5.         function getContent(graphic){  
  6.           var Content = "<b>City Name:  </b>" + graphic.attributes.areaname + "<br> <b>Population:  </b>" + graphic.attributes.pop2000 + "<br>";   
  7.           var Hyperlink = '<video width="250" height="250" controls><source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4></video> ';  
  8.         
  9.           return Content + Hyperlink;  
  10.         }     

Outcomes