I’m still trying to figure this out…
I think I need to use postMessage to communicate with the iframe.
I found the playerjs spec doc which suggests the following should do the trick:
document.querySelector('iframe').contentWindow.postMessage(
JSON.stringify({
context: 'player.js',
version: 'version',
method: 'play'
})
);
However, when I use this, I get a TypeError: Not enough arguments error.
Any ideas on what I’m doing wrong?