I am using bootstrap slider on my page. I need to pause the currently playing video when slider moves to the next one. I tried using youtube callback but it doesnt seems like working, may be my way of applying is not right.
here is what I have used
jQuery(function ($) {
$('div.carousel-inner div.active').attr('id', 'current');
});
function callPlayer(frame_id, func, args='') {
if (window.jQuery && frame_id instanceof jQuery) frame_id = frame_id.get(0).id;
var iframe = document.getElementById(frame_id);
if (iframe && iframe.tagName.toUpperCase() != 'IFRAME') {
iframe = iframe.getElementsByTagName('iframe')[0];
}
if (iframe) {
iframe.contentWindow.postMessage(JSON.stringify({
"event": "command",
"func": func,
"args": args || [],
"id": frame_id
}), "*");
}
jQuery(function ($) {
$('div.carousel-inner div.item').attr('id', '');
$('div.carousel-inner div.active').attr('id', 'current');
});
}