I embedded a Vimeo iframe in a WYSIWYG field, and I have MyTube filter the field. But the Vimeo thumbnail does not appear, and I receive the following error message:

Warning: file(/srv/bindings/765658a838594dcd85a00c2348c30206/tmp/87048482.xml): failed to open stream: No such file or directory in _mytube_download_thumb() (line 647 of /srv/bindings/765658a838594dcd85a00c2348c30206/code/sites/all/modules/contrib/mytube/mytube.module).

The Vimeo code I am embedding:
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="https://player.vimeo.com/video/108018156" webkitallowfullscreen="" width="500"></iframe>

CommentFileSizeAuthor
#1 vimeo_thumbnails_not-2505305-1.patch1.43 KBjfrederick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jfrederick’s picture

Status: Active » Needs review
FileSize
1.43 KB

Here is a patch.

MyTube downloads a video-specific XML file from Vimeo, which it parses to find the thumbnail URL. It constructs the URL to the XML file in _mytube_download_thumb() on line 645, but the URL returns a 404.

Vimeo has a newer API, which has a simpler URL structure for downloading the appropriate XML file.

I swapped in the new API URL, and adjusted the regex accordingly to correctly find the thumbnail in the slightly different API response.

Old URL:

http://vimeo.com/moogaloop/load/clip:108018156/embed/?param_server=vimeo.com&param_fullscreen=1&param_show_title=1&param_show_byline=1
&param_clip_id=108018156&param_autoplay=1&param_color=00ADEF&param_show_portrait=1
&param_loop=0&context_id=null

New URL:
https://vimeo.com/api/v2/video/108018156.xml

milodesc’s picture

Status: Needs review » Reviewed & tested by the community

This patch seems to be working well!

hey_germano’s picture

The patch in #1 works for me, too.

  • mfb committed f573dc6 on 7.x-1.x authored by jfrederick
    Issue #2505305 by jfrederick: Vimeo thumbnails not appearing
    
mfb’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.