0 Replies Latest reply on Feb 27, 2014 9:34 AM by travis.self

    Embedding a video via <script> tag versus <iframe>


      I've sucessfully embedded a youTube video before via an <iframe>, but I am having difficulty embedding a video through a <script> tag. The third party video platform that I am having to go through only offers this method of embedding so I am stuck with trying to come up with a workaround.


      Here's my code (inserted into document.compositionReady):


      var familyVideo = document.createElement('script');
      familyVideo.type = "text/javascript";
      familyVideo.src = "URL HERE";  // note: URL is propietary so I cannot share that with the forum



      I know that with youTube videos, the code is something as follows:


      var youtubevid = $("<iframe/>");
      youtubevid.attr('type', 'text/html');
      youtubevid.attr('width', '387');
      youtubevid.attr('height', '218');
      youtubevid.attr('src', 'URL HERE');
      youtubevid.attr('frameborder', '0');
      youtubevid.attr('allowfullscreen', '0');


      I've tried both methods (swapping <iframe> with <script> in the second method), and neither seem to work. Is there some sort of hold up that I am not aware of that allows us to embed <iframes> into our Edge elements, but not <script> tags? Any help is greatly appreciated.