Embed Hidden Vimeo Video using Secure HTML5 Video Player for WordPress

By December 6, 2012 WordPress

Vimeo and Secure HTML5 Video PlayerI am using the WordPress plugin Secure HTML5 Video Player for WordPress. I have a Vimeo Pro account and have a situation where I need to hide the videos from vimeo.com but open up the possibility of embedding these videos only on sites that I choose.

I only have one problem with Vimeo. For some reason, the videos are not playing on the Samsung Galaxy II device. The videos plan on everything else from desktops, iPhones, iPads, most Android devices, etc. Just not on the Samsung Galaxy II.

My hope was to be able to utilize the Secure HTML5 Video Player plugin to bypass this problem by setting Vimeo as the main player and a self-hosted mp4 file as the backup just for those Samsung Galaxy II users.

Everything seemed to be working just fine until I was unable to show the hidden Vimeo Pro videos on the website using the plugin shortcode. If I used the Vimeo iFrame, the hidden videos showed fine. If I used the plugin shortcode, no video showed up.

Solution

The way I fixed this was by changing some code in the sh5vp-functions.php file. You can find this by going here wp-content/plugins/secure-html5-video-player/sh5vp-functions.php and doing the following:

Go to line 114 of the code and change the Vimeo URL from:

http://vimeo.com/api/v2/video/{$vimeo_video_id}.php

to

http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/{$vimeo_video_id}

This allowed me to use the shortcode just for Vimeo videos or using a shortcode containing both Vimeo and MP4 files. The last thing to do here to make Vimeo the first choice is to go to the Plugin settings within the WordPress admin area, go to the Allow Youtube or Vimeo to be displayed area and choose As the primary, but use HTML5 video when the Youtube/Vimeo video is not available.

For more details from Vimeo, go here:
Oembed: https://developer.vimeo.com/apis/oembed
API: https://developer.vimeo.com/apis/simple

Erik Rostad

Author Erik Rostad

Erik Rostad started EPR Creations in May 2008. He works with universities, international organizations, and executives on their online presence.

More posts by Erik Rostad

Leave a Reply