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.
We have a use case where we need to programmatically show the video stored in the field ourselves though the API makes it hard for us.
Suggested changes:
Make
getVideoId()
a public method.
I'd also like to add a method to be able to retrieve the video URL used for embedding.
Comments
Comment #2
rp7 CreditAttribution: rp7 commentedMy project has the same requirement. Would be great!
Comment #3
boshtian CreditAttribution: boshtian at Agiledrop - Your Trusted Drupal Teammates commentedI have the same requirement and I was just wondering if there's any reason that this function is protected? Maybe maintainers would know more about it.
You can get the id using getIdFromInput() function though.
Comment #4
rp7 CreditAttribution: rp7 for Government of Flanders commentedPatch attached makes the getVideoId() function public.
Comment #5
rp7 CreditAttribution: rp7 for Government of Flanders commentedComment #6
Rene BakxI second this, I'm working in a field formatter to render the video's using the Plyr and it would save a lot of hassle if I could just do
What needs to be done to get's this patch committed and a new release pushed for Drupal 8?
Comment #7
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedHm, as someone pointed out, you could just go:
$provider::getIdFromInput($item->value)
Any reason this isn't possible in a formatter? Hesitant to push out new releases of this module, with media in core slowly taking over the primary use case.
Comment #8
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedWith the advent of Media in core, the Video Embed Field module has moved to being minimally maintained. Only issues which assist in the migration to Media in core will be committed. To read more about this decision, please see: #3089599: Maintenance status for Video Embed Field now that media is in core.