Execute Javascript

Jan 20, 2018

Hi, I am trying to embed a video on my project. The issue is that my company is using video player in the source url, that only provide a javascript or a flash embed code, instead of an iframe code. The code is in the following format -

<script type="text/javascript" src="https://video.example.com/vportal/scripts/videoplayer/DmsEmbedLib.js"></script>

<script>if(document.getElementById("showAndSharePlayerC-ac12a4e7-b5b5-4e64-968b-13f8ff27cb10:2")){document.getElementById("showAndSharePlayerC-ac12a4e7-b5b5-4e64-968b-13f8ff27cb10:2").innerHTML=dmsEmbed.getSimplePlayer("C-ccc14127-f1a7-4b58-b967-5efc307d568d:4","url", "false", 600 )}else{document.write(dmsEmbed.getSimplePlayer("C-ccc14127-f1a7-4b58-b967-5efc307d568d:4","url","false",600,"false"))}</script>

I have replaced all locations (url etc.), as I cannot share them.  

I have two questions -

1. I found a workaround by creating a .html file with this code and then using "iframe" to embed that in the story file. It's working, but I want to avoid that route if I can help it. I have some 25 videos to embed and I don't want to create 25 local files for that. Is there any other way I can use the above code snippet for embedding?

2. I tried to execute the javascript directly using a trigger, but that's not working for me. I am assuming it is because there is some formatting issue. Can someone help me with formatting the above? Is it possible to load the video using javascript directly?



1 Reply

This discussion is closed. You can start a new discussion or contact Articulate Support.