I went ahead and built a POC:
Here is the entire contents of the <body>
tag:
<script is="dmx-flow" id="flow1" type="text/dmx-flow">{
runJS: {
function: "loadVideo",
args: ["{{vimeo_id.value}}"]
}
}</script>
<dmx-value id="vimeo_id" dmx-bind:value="480055386"></dmx-value>
<div id="video1"></div>
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
function loadVideo(vimeo_id) {
var options01 = {
id: vimeo_id,
width: "900px"
};
var video01Player = new Vimeo.Player('video1', options01);
video01Player.setVolume(0);
video01Player.on('play', function() {
console.log('Played the first video');
});
}
</script>
<script src="bootstrap/4/js/popper.min.js"></script>
<script src="bootstrap/4/js/bootstrap.min.js"></script>
It consists of a variable – this holds the vimeo id. Using a var is just an easy way for me to provide a value from app connect–using other dynamic data will work as well.
There is a function loadVideo that takes one parameter, the vimeo_id.
There is a flow. When run it calls the javascript function and passes it the value from the var.
There is a trigger on app ready, that runs the flow.
On page load, the video comes up, ready to play!