sending variables > iFrame embedding (interactive video)
Submitted by elodesignoco on Mon, 05/07/2018 - 06:05
Forums:
Hi there,
I have a shortcode method on the main part of my site that allows we to pass variables to the page that are stored in a custom table. However, with h5p interactive video being an iFrame embed this is never going to get processed.
If I put the shortcode into a link item within the interactive video it will render like:
<a href="http://www.[purl key="linkename"].com" target="_blank">[purl key="firstname"]</a>
Has anyone successfully passed variables from the main wordpress build into the iframe and successfully connected them up to content types?
cheers
mark
Summary:
Dynamic Variables inserted into iframe
otacke
Wed, 05/09/2018 - 17:23
Permalink
If you are familiar with
If you are familiar with JavaScript and you can, there may be a way.
You'd have to get a reference to the content iframe first which holds the H5P object. From there, you should be able to modify the video's contents (after the DOM has loaded). The H5P object holds an array named instances which will contain the InteractiveVideo object. If you're familiar with coding, the following example should help you.
Try going to our demo of Interactive Video, open a console window (F12), paste the following code, press enter, and see what happened to the video ...
So, if you can resolve your shortcode and pass the value to JavaScript, you can also replace any identifier that you put inside an interaction's text field.