I have a wistia video hidden by default and a custom play button that makes the video appear. When that button is clicked, I not only want the video to appear and start playing, but I want it to go directly into full screen mode. Looking through their JavaScript API, I don't see an option to put it in full screen mode. All I see is an option to allow it to be in full screen. Is there a way to accomplish this, or does the user have to actually click the full screen button in the video player for this to happen?
You can just seek for video tag after wistia video is set up to playback mode. In their docs no another solution for this. Take a look:
// get wistia video object through their api
var wistiaVideo = Wistia.api('your video id');
$('#your-custom-play-button').on('click', function() {
wistiaVideo.play();
// now just look for video tag inside wistia video container
var video = $('.your-video-container').find('video')[0];
// check whether your browser has ability to run it in fullscreen mode
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.mozRequestFullScreen) {
video.mozRequestFullScreen();
} else if (video.webkitRequestFullscreen) {
video.webkitRequestFullscreen();
} else if (video.webkitEnterFullscreen) {
video.webkitEnterFullscreen();
}
});