Problem/Motivation

Let's have this module a first-class citizen in the D8Media Initiative.

Proposed resolution

As discussed with D8Media folks during meetings, Daniel's https://github.com/dawehner/media_entity_brightcove should be a submodule here.

Remaining tasks

Copy code from GitHub. Have this documented.

User interface changes

API changes

Data model changes

There's still an ongoing debate over in #2625854: Provide default source_field when creating new media entity bundles which might have an effect on how the fields gonna be created.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Boobaa created an issue. See original summary.

  • Boobaa committed 1f68b87 on 8.x-1.x
    Issue #2820436 by dawehner, Boobaa: Integrate with media_entity
    
    copied...
dawehner’s picture

I'm quite glad that you are picking up the idea! Conceptually it totally always made sense for me to let brightcove be part of the larger ecosystem

Boobaa’s picture

The attached patch needs a(t least one) minor change in core: either #2274433: Do not allow to alter Locked field via UI, #2887731: EntityreferenceAutocompleteWidget constraint cannot stop form submission or even both. Additionally, as media.module is only present in the upcoming drupal-8.4.x release's branch, I'm not committing this right now, but submitting here for review. The @MediaSource plugin in the patch is already prepared for #2865184: Allow MediaSource plugins provide default field form/view display settings as well.

Boobaa’s picture

Looks like I forgot about the constraints earlier, fixing this now. Checked if the bug reported in #2896582: Ensure \Drupal\media_entity_brightcove\Plugin\MediaEntity\Type\BrightcoveVideo::thumbnail always returns a file URI is still present here, but it's gone.

The related core bugs are still present, so I'm still not committing this.

pingwin4eg’s picture

Composer can't automatically apply the patch from #5. So here's the rerolled version for the current 8.x-1.x module's branch.

keithdoyle9’s picture

Any progress on the issue?

ccarrascal’s picture

I was still having trouble with composer to apply the patch in #6, so I had to modify it a little bit.
Now it works for me with the current 8.x-1.3 version of the module.

tariqinam’s picture

FileSize
78.09 KB

I applied patch #8 on version 8.x-1-3 with drupal 8.7.8 (media module enabled).

I created a media type of Brightcove video, and added media field to default article content type. In the form display setting, I selected entity browser to browse and upload BC video.

when creating a new article, I can browse a video successfully but when selected and try to add, an error comes up saying:

"Entity must be type of media"
See attached image. Is there anything not right here?

This entity browser view works fine when used with Brightcove video field itself to add video to a node.

kducharm’s picture

Re-rolled patch for 2.0

Dinesh18’s picture

Facing similar issues. Any idea how can we fix it ?

jan.mashat’s picture

Assigned: Unassigned » Boobaa
Status: Needs review » Needs work
jan.mashat’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Priority: Normal » Major
Boobaa’s picture

Attached patch does two things:

Rationale:

  • I'm not sure #3004209: Apply new {project}:{module} format for dependencies in info.yml actually supported core's Media module; based on [#2863992] it didn't actually happen.
  • Since #2865184: Allow MediaSource plugins provide default field form/view display settings also landed in core per [#2928238], I don't see other reasons to not support core's Media module by now.
  • As the new approach has nothing to do with the former media_entity module, media_brightcove seems to be a more proper name.
  • Some sites might still be using the media_entity approach (which might or might not work with the media_entity_brightcove submodule, I haven't tested), so I also kept that one without other changes than deprecation/hiding (so it cannot be enabled on the web UI, but if it worked that way, it should still work).
jan.mashat’s picture

Status: Needs review » Reviewed & tested by the community

  • Boobaa committed 7900823 on 8.x-2.x
    Issue #2820436 by Boobaa, pingwin4eg, ccarrascal, kducharm, tariqinam:...
Boobaa’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for all the inputs, all the best pieces have been included in the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dalin’s picture

Because this module didn't integrate with Media module for many years, and the alternative modules that did integrate are now no longer supported, it would be great to mention on the project description that this module now does integrate with Media module.