Popcorn has enable
and disable
methods that can turn any given plugin on and off.
Because you defined your popcorn instance inside the event listener function, you'll want to set up the click handler in there as well. So, for your html...
<input type="button" value="Captions" id="captions" class="button"/>
And your script...
document.addEventListener( "DOMContentLoaded", function() {
var popcorn = Popcorn( "#video" );
var showSubtitles = true;
document.getElementById('captions').addEventListener('click', function () {
//toggle subtitles
showSubtitles = !showSubtitles;
if (showSubtitles) {
popcorn.enable('subtitle');
} else {
popcorn.disable('subtitle');
}
}, false);
/* fill in your subtitles here... */
}, false );
Official documentation here: http://popcornjs.org/popcorn-docs/media-methods/#disable