Flowplayer · Double click to fullscreen

<body/>

<div class="flowplayer" data-ratio="0.4167">
<video>
<source type="video/webm" src="//edge.flowplayer.org/functional.webm">
<source type="video/mp4" src="//edge.flowplayer.org/functional.mp4">
</video>
</div>

HTML
var bean = flowplayer.bean; // Flowplayer internal DOM event manager
flowplayer(function(api, root) {
bean.off(root, 'click.player'); // Disbable internal click toggle
 
var clickHandlers = [];
 
bean.on(root, 'click', function() {
clickHandlers.push(setTimeout(function() { // Wait 500ms to see if it was a double click
api.toggle(); // Toggle playback
}, 500));
});
 
bean.on(root, 'dblclick', function() {
api.fullscreen(); // Toggle fullscreen
 
clickHandlers.forEach(function(handler) {
// Do not allow running click handlers
clearTimeout(handler);
});
clickHandlers = []; // Reset
});
});

JavaScript