Hi @Sam152,
it would be great to have option to enable thumbnails. As there was "Brightcove provider does not currently support thumbnails." exception inside provider class, I implemented it myself. Could you please review my patch? Thank you.
It provides simple UI for Brightcove API keys inserting (needs CMS Video Read permission) and then implements thumbnail download.
I'm using this approach in combination with "lazy load" formatter, but in this case, autoplay is not working. Any idea how to solve that? It's probably related to Chrome's autoplay restriction, but I'm curious if there is some workaround.
Best regards
Vit
Comments
Comment #2
kybermanComment #3
kybermanTo solve the autoplay issue, I added another feature into this patch (see interdiff). It adds config for "Autoplay player name" - if user fills this one and autoplay option is enabled for current formatter, configured player name overrides player name that was specified inside input URL. It allows user to create specific player for automatically played videos.
As a part of this new patch version, I merged patch https://www.drupal.org/files/issues/video_embed_brightcove-support_diffe..., so input player name could be respected.
Comment #4
kybermanI improved settings page descriptions and changed all fields to be optional, because someone does need only "Autoplay player name", someone only thumbnails download.
Comment #5
kybermanAnother improvement is bringing into validation for API keys.
Comment #6
murrayw commentedHi Sam, I have been working with Vit on this patch and I think that we have gotten it as far as we are going to in this round of development. Vit has captured all of the main points above pretty well. I will recap on what has been done:
- An admin screen with API fields has been added to handle the downloading of the thumbnails. These fields are optional and will not break any sites which do not want to populate these fields.
- We have extended this functionality to also handle lazy loading of Brightcove videos. Once again, the autoplay video ID is optional and will not break any sites which do not want to fill it in.
The lazy loading functionality was added into the patch because it would have been hard to do this in two patches because both needed to work with the admin screen.
We think the patch is a big improvement and opens the way for pages with many Brightcove videos on them: the thumbnails are shown as the preview and then lazyload when the thumbnail is clicked.
We will be using this patch in production and will report back any problems or fixes we have.
Comment #7
sam152 commentedI haven't been following this issue, but have bookmarked it and will take a squiz in the morning. Thanks!
Comment #9
sam152 commentedLooking great, thanks for both working on this. While I have some feedback, this is a big improvement on the functionality. The module doesn't have a stable release, so I think we can continue to iterate on this stuff, as time allows.
Since more of the code in the module has been written by @kyberman than me at this point, I've also granted you permission to maintain the project. Feel free to push features/fixes and manage releases if you have capacity to do so.
Thanks!
This configuration should have associated schema definitions.
Here we repeat a lot of information, like the URL of the API, how to authorise with it, loading the credentials from configuration.
This is a good candidate to split out into a seperate service. The service could have methods like
canConnectandfetchRemoteThumbnail, which encapsulate the details of the API/auth within them.I think we should define our own permission for this. This is quite broad.
Comment #10
kybermanThank you Sam!
Nice to see this patch is merged into and that I can help with this module.
I'll review your suggestions soon, probably during next week and prepare some refactoring.
Best regards
Vit
Comment #12
kyberman