Display the first two videos as a player

Created on 8 October 2015, about 9 years ago
Updated 28 May 2023, over 1 year ago

Hi, i'm trying to display the first two videos of the youtube channel as a player. By default the module only allow to display one and the others like a list. What I want to achieve is to display the first and the second videos in a media player.

The code i tried to modify is in the files .js and .tpl.php but without results.

It seems i have to modify something here:

(function ($) {
  function youtubechannel_setvideo(href) {
    youtubeid = href.replace("#","");
    jQuery('#youtubechannel-frame').attr('src','http://www.youtube.com/embed/' + youtubeid);
  }  

  Drupal.behaviors.youtubechannel = {
    attach: function (context, settings) {
      if (jQuery('#youtubechannel-list a:first').length) {
        youtubechannel_setvideo(jQuery('#youtubechannel-list a:first').attr('href'));
        jQuery('#youtubechannel-list a').click(function(e) {
          youtubechannel_setvideo(jQuery(this).attr('href'));
          return false;
        });
      }
    }
  }
}(jQuery));

But without any success. Can you lend me a hand?

💬 Support request
Status

Fixed

Version

2.1

Component

Code

Created by

🇦🇷Argentina HomerO

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024