Module needs a Drupal 8 version. I needed to get my feet wet and this seemed like a good one.
This should be viewed as experimental.

CommentFileSizeAuthor
#18 youtube.zip17.14 KBAnonymous (not verified)
#15 youtube-drupal8-2119845-17.patch58.88 KBAnonymous (not verified)
#9 youtube-drupal8-2119845-9.patch75.71 KBAnonymous (not verified)
#8 youtube-drupal8-2119845-8.patch58.91 KBAnonymous (not verified)
#7 youtube-drupal8-2119845-7.patch73.78 KBAnonymous (not verified)
#6 youtube-drupal8-2119845-6.patch60.04 KBAnonymous (not verified)
#5 youtube-drupal8-2119845-5.patch74.85 KBAnonymous (not verified)
#2 youtube-drupal8-2119845-2.patch68.38 KBAnonymous (not verified)
#1 youtube-drupal8-2119845.patch68.41 KBAnonymous (not verified)
youtube-drupal8-xxxx-1.patch68.47 KBAnonymous (not verified)

Comments

Anonymous’s picture

Assigned: Unassigned »
StatusFileSize
new68.41 KB

Token support now working.

Anonymous’s picture

StatusFileSize
new68.38 KB

Added Feeds support.

Anonymous’s picture

Issue summary: View changes

token support is working with new patch

guschilds’s picture

pferlito,

Thanks for your work on this so far!

Been rather busy lately, but I can't wait to look through it as soon as I get the chance.

Gus

Anonymous’s picture

Great! Thanks for checking in and for your work in the queue.

Anonymous’s picture

Issue summary: View changes

Feeds integration done.

Anonymous’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new74.85 KB

Adding tests. Should be ready for review.

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new60.04 KB

Adding responsiveness. Ready for review.

Anonymous’s picture

StatusFileSize
new73.78 KB

Changes to keep up with D8 HEAD.

Anonymous’s picture

StatusFileSize
new58.91 KB

Now using git format-patch.

Anonymous’s picture

StatusFileSize
new75.71 KB

New and improved version.

Anonymous’s picture

Anonymous’s picture

kristen pol’s picture

Status: Needs review » Needs work
  1. +++ b/lib/Drupal/youtube/Plugin/Field/FieldFormatter/YouTubeFormatter.php
    @@ -0,0 +1,154 @@
    +    );
    +
    

    Nit pick... extra space compared to the other code.

  2. +++ b/lib/Drupal/youtube/Plugin/Field/FieldFormatter/YouTubeFormatter.php
    @@ -0,0 +1,154 @@
    +    foreach ($parameters as $parameter) {
    +    if ($parameter) {
    +        $cp = t(', custom parameters');
    +        break;
    +      }
    +    }
    +    $summary[] = t('YouTube video: @youtube_size@cp',array('@youtube_size' => $youtube_size,'@cp' => $cp));
    

    Don't think this will do what is intended... it will break out on the first parameter.

  3. +++ b/lib/Drupal/youtube/Plugin/Field/FieldFormatter/YouTubeFormatter.php
    @@ -0,0 +1,154 @@
    +  public function prepareView(array $entities_items) {
    +  }
    

    Is this intentionally blank? If so, perhaps add a comment? Not sure what is standard in core.

  4. +++ b/lib/Drupal/youtube/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php
    @@ -0,0 +1,114 @@
    +    $image_link = $this->getSetting('image_link');
    +    $image_link = !empty($image_link) ? t(" linked to @image_link",array('@image_link' => $image_link)) : "";
    

    Extra space before "linked"?

    Add space before array().

  5. +++ b/lib/Drupal/youtube/Plugin/Field/FieldFormatter/YouTubeThumbFormatter.php
    @@ -0,0 +1,114 @@
    +  public function prepareView(array $entities_items) {}
    +
    

    Is this the standard way to have an empty function? This is different than the other one above.

  6. +++ b/lib/Drupal/youtube/Plugin/Field/FieldType/YouTubeItem.php
    @@ -0,0 +1,80 @@
    +    if (!isset(static::$propertyDefinitions)) {
    +      static::$propertyDefinitions['input'] = array(
    +        'type' => 'string',
    +        'label' => t('video url'),
    +      );
    +      static::$propertyDefinitions['video_id'] = array(
    +        'type' => 'string',
    +        'label' => t('Video id'),
    +      );
    +    }
    

    "video url" is lowercase and "Video id" starts with uppercase. Not sure what is intended.

  7. +++ b/lib/Drupal/youtube/Plugin/Field/FieldWidget/YouTubeDefaultWidget.php
    @@ -0,0 +1,99 @@
    +    } elseif (!empty($input)) {
    +      form_error($element,'Invalid URL format');
    +    }
    

    elseif should be on new line.

  8. +++ b/lib/Drupal/youtube/Tests/YouTubeTest.php
    @@ -0,0 +1,180 @@
    +
    +    // Verify that the image markup is displayed
    

    Nit pick: Period missing at end of sentence.

  9. +++ b/lib/Drupal/youtube/Tests/YouTubeTest.php
    @@ -0,0 +1,180 @@
    +    // Verify that the remote image is created
    

    Nit pick: Period missing at end of sentence.

  10. +++ b/youtube.module
    @@ -29,468 +29,517 @@ function youtube_permission() {
    -    return $summary;
    +  // Check if an url path is provided
    

    Nit pick: Period missing at end of sentence.

  11. +++ b/youtube.module
    @@ -29,468 +29,517 @@ function youtube_permission() {
    +/**
    + * Get images by building correctly formed URL - kinda hackey.
    

    I think it's "hacky" :)

maryedith’s picture

Tested the D7 and D8 sites this evening.

For the most part things work well and identically. I did notice that in D8, when editing a node, a YouTube Field is not labeled with the label given the field in the content type. It instead is labeled "Video URL". This may be intended behavior in D8?

In both D7 and D8 we noticed that the System-level "Do not show YouTube logo on video player (modestbranding)." option ONLY took effect after some Field-level configurations of the YouTube field had been toggled.
AFTER changing some field-level configuration options this System-level config item DID take effect.

erutan’s picture

Some notes, I got the patched module running on a vagrant box.

@ http://drupal8.scdug.local/admin/structure/types/manage/article/display - sometimes after editing options under youtube video, the gear icon won't open until a refresh. this can also be fixed by switching between video and thumbnail display modes. This might just be some weird core behavior? It is alpha 6 after all.

@ http://drupal8.scdug.local/admin/config/media/youtube I'd recommend a change in wording to make it more explicit about what is happening (as there is a youtube logo that will load itself over the video).

  • orig: Do not show YouTube logo on video player (modestbranding).
  • option1: Do not show YouTube logo on video player control bar (modest branding).
  • option2: Do not show YouTube logo on video player controls (modest branding).

after switching to responsive display mode @ http://drupal8.scdug.local/admin/structure/types/manage/article/display the following error occurred when viewing the piece of content I had made with the embedded video image.

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("The PHP cURL extension must be installed to use Guzzle.") in "core/themes/bartik/templates/page.html.twig" at line 167. in Twig_Template->displayWithErrorHandling() (line 279 of /var/www/core/vendor/twig/twig/lib/Twig/Template.php).

This persisted throughout cache clears, but going back to http://drupal8.scdug.local/admin/structure/types/manage/article/display and changing it to another setting fixed it. Changing it back to responsive again did not yeild the same result and it displayed fine.

Anonymous’s picture

StatusFileSize
new58.88 KB

Kristen:

#1. I can't find the space. I'm not going to worry about it.
#2. I looked at the code and it does what is intended which is to show "custom parameters" if any one of the custom parameters is set. This is the same as the D7 module.
#3. The method must be declared because the base class implements an interface that includes the method. It's standard to do this without comment.
#4. Done
#5. Yes it's the standard way. I made them both one-liners for consistency.
#6. Changed to uppercase
#7. Done
#8. Done
#9. Done
#10 Done
#11 Done

Mary Edith:
#1. Fixed
#2. Can't reproduce

Carl:

#1. Yes I'm going to blame that on core. My code doesn't control that.
#2. I chose option 1. Thanks!
#3. I'm unable to reproduce that result

Anonymous’s picture

Status: Needs work » Needs review
juliavdw’s picture

Status: Needs review » Reviewed & tested by the community
Anonymous’s picture

StatusFileSize
new17.14 KB

Adding a zip file.

Anonymous’s picture

Issue summary: View changes
guschilds’s picture

Status: Reviewed & tested by the community » Fixed

Thanks so much, pferlito, for your work on this and many thanks to those who have reviewed it as well. I have committed the attached zip from #18 to a new 8.x-1.x branch. I have also made mention of this effort on the project page in hopes to better track progress towards an 8.x-1.0 release.

Future folks: please open new issues for all features, bugs, etc. regarding 8.x-1.x rather than re-opening this one.

Status: Fixed » Closed (fixed)

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

jenlampton’s picture

Great job on the early 8.x version everyone! :)