Needs work
Project:
Video Embed Field
Version:
3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2021 at 22:17 UTC
Updated:
8 May 2026 at 13:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
puiduComment #3
puiduComment #4
markgp commented#3 doesn't work for us. Our users are pasting the share link into the field, which has the hash as the second URL segment rather than a query string.
Here's a patch that covers both cases.
Comment #5
sokru commented#4 works nicely, but I'm setting "Needs work" since I expect module maintainer would like to have test coverage for this.
Comment #6
nathan tsai commented#4 works on 2.4!
I encountered this issue when trying to embed an unlisted video, with the format:
https://vimeo.com/{id}/{hash}?embedded=true&source=vimeo_logo&owner={owner-id}I had to remove the query parameter though (e.g.
https://vimeo.com/{id}/{hash}) in order for it to work.Could we update the regex string to support having excess query parameters? Perhaps by removing the
$from the end of the regex?For example, using
^https?:\/\/(www\.)?vimeo.com\/(channels\/[a-zA-Z0-9]*\/)?(?<id>[0-9]*)(\/(?<hash>[a-zA-Z0-9]+))?(\#t=(\d+)s)?instead.See https://regex101.com/r/ZQGI9K/1 vs https://regex101.com/r/ZQGI9K/2.
Comment #7
recrit commentedThe patch attached is an update to the patch #4 that adds the following:
- Support PHP 8: The patch fixes the warning: "Deprecated function: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated".
- Removes the trailing "$" from the regex to allow for other query parameters to be on the input string. This addresses the comment in #6.
Comment #8
recrit commentedRe-uploading the patch as it was 0 bytes by mistake.
The patch attached is an update to the patch #4 that adds the following:
- Support PHP 8: The patch fixes the warning: "Deprecated function: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated".
- Removes the trailing "$" from the regex to allow for other query parameters to be on the input string. This addresses the comment in #6.
Comment #9
d70rr3s commentedThis is great, we stumble on this issue without knowing was about the hash since the error thrown by the request was a little bit cryptic. Any way, RTBC on Drupal 8.9 and module version 2.4. Many thanks, great work!
Comment #10
sagesolutions commentedSetting to RTBC as per d70rr3s
Comment #13
kunal_sahu commentedHi @all Thanks you for all your patches. The patch video_embed_field-vimeo_hash_parameters_private_video-3238136-8.patch applied successfully.
PS C:\xampp\htdocs\drupal\web\themes\custom\video_embed_field-2580459> git apply -v .\youtube_autoplay-2580459-25.patch
Checking patch video_embed_field.handlers.inc...
LGTM.
Creating an MR for helping out maintainer. Thanks recrit for the patch . Thanks
Comment #14
cslevy commentedThe patch doesn't apply anymore.
Created a new patch which applies to the latest dev version
Comment #15
mably commentedHi @cslevy, could you provide an MR against 3.0.x please?
Comment #16
mably commentedComment #17
ezeedub commentedHere's an updated patch for 3.0.x
Comment #18
mably commentedHi @ezeedub, thanks for your patch. Could you create an MR please?
Comment #19
mably commentedComment #20
bkosborneThe patch doesn't appear to work for the input example provided in the original report: https://player.vimeo.com/video/607242810?h=47f19305fd&autoplay=0This is because the main regex that's used for validating if the Vimeo provider can parse the input doesn't allow query string parameters. This was mentioned in #6 and it wasn't completely addressed. The regex in
getIdFromInputneeds to be updated to remove the $ at the end.Nevermind, I see that video URL was the embedded version of the URL, not the source URL that someone would paste in.
And yes, the patch should be converted to an MR.
Comment #21
bkosborneClosed #3270201: For Vimeo videos in format vimeo.com/ABC/123, the popup should be https://player.vimeo.com/video/ABC?h=123, not https://player.vimeo.com/video/ABC as a duplicate of this.
Maintainer, please update contribution record to add people that contributed in that issue as well.
Comment #26
bkosborneComment #27
bkosbornePorted over the MR from the other issue and updated it to fix a few things. Unit tests passed locally. This should be good to go.
Comment #28
znak commentedAdded patch for version 3.0.0
Comment #29
mably commentedMR needs to be updated: linting errors and failing tests.