Hi Eric,

We're in process of having Vidyard part of our websites. And it seems your contrib module will simplify our integration, so thank you! :)

As I am going through Vidyard documentation, I noticed they have updated their embed code markup. Not sure how recent that change is, but some of their documentation is still has references to older versions.

However, this the most recent markup I could find on Vidyard:

<!-- The script tag should live in the head of your page if at all possible -->
<script type="text/javascript" async src="https://play.vidyard.com/embed/v4.js"></script>
<!-- Put this wherever you would like your player to appear -->
<img
  style="width: 100%; margin: auto; display: block;"
  class="vidyard-player-embed"
  src="https://play.vidyard.com/VIDEO_ID.jpg"
  data-uuid="VIDEO_ID"
  data-v="4"
  data-type="inline"
/>

With the new version, they also seem to support responsive embed by default, which is perfect.

I created a patch to reflect those changes. Let me know what you think of it.

Comments

osman created an issue. See original summary.

osman’s picture

Status: Active » Needs review
StatusFileSize
new3.42 KB
eric115’s picture

Thanks for your patch! I haven't worked with vidyard in quite some time now, do you have a link to the documentation relating to this change?

This new syntax looks like it might be more suited to a twig file, which might be easier to override at a theme level as well, do you have any thoughts about something like that?

zaporylie’s picture

+++ b/video_embed_vidyard.info.yml
@@ -4,4 +4,4 @@ description: Provides Vidyard handler for Video Embed Fields.
+  - video_embed_field:video_embed_field

I don't think this change belongs here as of #3035286: Update Dependencies to new Format in .info.yml

Re #3 - this doesn't sound like a bad idea.

How much of a disruption would this change cause to existing userverse. I wonder if users will suffer from broken styling when updating from 8.x-1.0 to 8.x-1.1? If so - should this change target 8.x-2.0 for the sake of sanity even if upgrade path is non-existing due to a full compatibility between major versions.

osman’s picture

Agreed, dependency change should have been part of #3035286: Update Dependencies to new Format in .info.yml, I'll post an updated patch without it.

The styles removed by this patch (#2) was used to create a responsive embed experience.

--- a/css/video_embed_vidyard.css
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Set vidyard span wrappers for responsive videos. */
-/* Ref: http://knowledge.vidyard.com/33007-publish-your-player/245140-make-an-inline-player-responsive */
-.video-embed-field-responsive-video .vidyard_player {
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-}
-
-.video-embed-field-responsive-video .vidyard_player > span {
-  width: 100% !important;
-  height: 100% !important;
-  margin: 0 auto !important;
-}

Vidyard's v4 implementation introduced in this patch, already creates a responsive embed markup. Though I opted to remove the inline CSS width: 100%; margin: auto; display: block; introduced by Vidyard's official responsive embed code. Drupal doesn't need that inline CSS, IMO.

osman’s picture

StatusFileSize
new3.06 KB
osman’s picture

Eric, at first glance I overlooked the existence of the video_embed_field/templates/video-embed-iframe.html.twig, then thought a template could be added as a new feature in a separate issue.

But, I'll see if I can update the patch with a twig template, later in the day.

Do you see any other issues may need addressing?

osman’s picture

StatusFileSize
new4.61 KB
new2.13 KB
osman’s picture

With added patch, the template variables can now be altered as defined in video_embed_field.

function hook_preprocess_video_embed_iframe__vidyard(&$variables) {
  // Add new attributes.
  $variables['attributes']['data-genre'] = 'Sci-Fi';
}
zaporylie’s picture

StatusFileSize
new5.33 KB
new1.46 KB

Adding new pattern and updating test

zaporylie’s picture

StatusFileSize
new5.72 KB
new646 bytes

ok. the watch pattern that is failing is actually allowed so I'm removing failing test.

amourow’s picture

#11 works with the latest dev

amourow’s picture

video_embed_field module has responsive video option which will add .video-embed-field-responsive-video to the video container. It will cause extra padding-bottom in the container despite the vidyard player has responsive layout.

I add only one css back to revert the extra padding from video_embed_field css.

amourow’s picture

StatusFileSize
new3.19 KB
new5.96 KB

Add missing library definition for css.

amourow’s picture

StatusFileSize
new5.95 KB
new3.27 KB
nnminhthao@gmail.com’s picture

I was working with the 2.0 branch and create a patch for that based on #11 https://www.drupal.org/project/video_embed_vidyard/issues/3444212
Thank you zaporylie!