Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looks like some vimeo embed urls do not contain the vimeo_id (ex: http://vimeo.com/daviddelossan/flowers-timelapse), and when that is the case, the video player does not load. However once you paste that url into a browser, it redirects to https://vimeo.com/98276732 which does contain the vimeo_id. Using the resulting redirected url loads the player.
So looks like a patch will need to be created that checks if the vimeo embed url has a redirect, and if it does, then the resulting redirected url should have the vimeo_id thus allowing the player to be loaded.
Comment | File | Size | Author |
---|---|---|---|
#1 | video_embed_field-vimeo_embed_url_redirect_to_grab_vimeo_id-2301065-1.patch | 3.49 KB | Bao Truong |
Comments
Comment #1
Bao Truong CreditAttribution: Bao Truong commentedI created a patch that looks to see if the vimeo embed url has a redirect and if so, grab the vimeo_id which should be present in the resulting redirected url.
The code used to grab the redirect from the url was inspired by the following post at:
http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php
The only file that was modified in this patch is video_embed_field.handlers.inc, and the function modified was _video_embed_field_get_vimeo_id which now uses the newly created functions to grab the redirected url (_video_embed_field_get_redirect_url, _video_embed_field_get_all_redirects and _video_embed_field_get_final_url).