Reputation: 591
I have a site with a vimeo video player that I am embedding using Vimeo's PHP example.
External control buttons on the site need to seek to different "tracks" inside the Vimeo video, that is inside an iframe.
Upvotes: 1
Views: 585
Reputation: 591
Use postMessage
to pass JSON string data back to the iframe.
function skipTo(time) {
var f = jQuery("#vid_player iframe");
var url = f.attr('src');
var data = {method: "seekTo", value: time};
f[0].contentWindow.postMessage(JSON.stringify(data), url);
}
See API documentation that was somewhat helpful, but at least has a list of other methods you may need to utilize: http://api-portal.anypoint.mulesoft.com/vimeo/api/vimeo-javascript-api/docs/reference
Upvotes: 1