SocialEngine 4: How To Change Video Thumbnail Size

Andrew - SocialEngineDo you find your Video Thumbnail Size is too small? If so, follow this guide to increase the sizes of you video uploads’ thumbnails!

 

 

 

 

Open \application\modules\Video\controllers\IndexController.php file. Find these lines (start at line #970):

// handles thumbnails
  public function handleThumbnail($type, $code = null){
    switch ($type) {
      //youtube
      case "1":
        //http://img.youtube.com/vi/Y75eFjjgAEc/default.jpg
        return "http://img.youtube.com/vi/$code/default.jpg";
      //vimeo
      case "2":
        //thumbnail_medium
        $data = simplexml_load_file("http://vimeo.com/api/v2/video/".$code.".xml");
        $thumbnail = $data->video->thumbnail_medium;
        return $thumbnail;
    }  
  }

Replace them with these lines:

// handles thumbnails
  public function handleThumbnail($type, $code = null){
    switch ($type) {
      //youtube
      case "1":
        //http://img.youtube.com/vi/Y75eFjjgAEc/default.jpg
        //return "http://img.youtube.com/vi/$code/default.jpg";
        return "http://img.youtube.com/vi/$code/0.jpg";
      //vimeo
      case "2":
        //thumbnail_medium
        $data = simplexml_load_file("http://vimeo.com/api/v2/video/".$code.".xml");
        $thumbnail = $data->video->thumbnail_medium;
        return $thumbnail;
    }  
  }

Now you will get 480x360px thumbnail from Youtube instead of 120x90px. After this, you need to change the size of image which is saved on your system. Find line #241 in the same file. It should look like this:

$image->open($tmp_file)
          ->resize(256, 192)
          ->write($thumb_file)
          ->destroy();

Replace the 256, 192 with width and height you need for your thumbnail.
There is one more step. In the same file, find line #819:

$image->open($tmp_file)
          ->resize(256, 192)
          ->write($thumb_file)
          ->destroy();

It’s the same code as previous and you should put the same values as before for width and height.

Looking for quality SocialEngine Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , , , , , , | Posted under SocialEngine | RSS 2.0

Author Spotlight

Andrew Cross

Hi, I'm Andrew. A am a 26, ICT Administrator which offers support to company's around the South Wales Area. I have created a few social sites for myself and other company's. So far 2 out of 3 have been successful using the powerful SocialEngine Script. I continue to try and help the community of SocialEngine by giving Support and Technical Help where possible.

9 Comments on SocialEngine 4: How To Change Video Thumbnail Size

  1. David says:

    It ‘s really useful for my socialengine site. Thanks for your tutorial

  2. gustavo says:

    hello you can make changes to Social Engine 4.8.8? and if possible when you installed on wall

  3. gustavo says:

    hello friend, thanks for the help, but you know I could not do it, that members of my website can add HTML coding your comment boxes, help please

  4. gustavo says:

    Hello friend, when I add the url of youtube I get this error We could not find a video there – please check the URL and try again.

Leave a Reply

Your email address will not be published. Required fields are marked *