During some operations, the BrightcoveVideo.php loads the Video from Brightcove. However we don't have access to this object in operations like hook_entity_presave() and my experience is that calling the API again is inefficient/slow.

I would like the BrightcoveVideo object to store the Video in a property, which can be accessed later, for example:

function mymodule_brightcove_video_presave(BrightcoveVideo $videoEntity) {

  /** @var \Brightcove\Object\Video\Video $bcVideo  **/
  $bcVideo = $videoEntity->getVideo();
  $videoEntity->set('someproperty', $bcVideo->someProperty()));
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sime created an issue. See original summary.

sime’s picture

An attempt to solve.

dawehner’s picture

sime’s picture

That is definitely one way to do it. What i noticed is that calling the API again takes twice as long for a lot of videos. So this problem is really more like: why do I have to hit the endpoint again? why is the brightcove module abstracting the Brightcove API response away from me so much that I have to hit the API again to access something?

dawehner’s picture

@sime
I totally agree with you. At least for me having this video object available was really useful.

daniel.nitsche’s picture

Ignore this sorry -- patch is for a different issue.

daniel.nitsche’s picture

yce’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

Why do you have to access the SDK's video entity? Is something missing from the Drupal video entity?

yce’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing this ticket as there was no feedback.