Vine: programmatically control playback

85 views Asked by At

I am embedding a Vine using the standard embed code they provide, which loads an iframe with the video. Since it's a cross-domain iframe I'm unable to access it via Javascript and play/pause the video.

I have a slider of Vines and would like them to play only when on screen.

Is there any way to play/pause a Vine via JS? I've not found anything in their documentation.

Thanks.

1

There are 1 answers

0
Sam Ward On

I've found references to YouTube's JS API (https://developers.google.com/youtube/js_api_reference) in Vine's JS, but it can't be accessed by the normal means. From scouring the internet, it looks like people used to have luck just with using something like

document.getElementById('vine_iframe').contentWindow.postMessage('pause', '*');

but that doesn't work anymore. It looks as though they've closed the embedded player JS api.