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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johndevman created an issue. See original summary.

rp7’s picture

My project has the same requirement. Would be great!

boshtian’s picture

I 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.

rp7’s picture

rp7’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Rene Bakx’s picture

I 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

$provider->getVideoId();

What needs to be done to get's this patch committed and a new release pushed for Drupal 8?

Sam152’s picture

Hm, 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.

Sam152’s picture

Status: Needs review » Closed (won't fix)

With 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.