Keyword

using video as image in Category

  • Denis Bonetti
  • Denis Bonetti's Avatar Topic Author
  • Offline
  • New Member
More
4 years 10 months ago #172334 by Denis Bonetti
using video as image in Category was created by Denis Bonetti
Hello
there is a way to use a youtube video or a video uploaded on my server as image in article?
I'd like to show in the category blog some articles that have a video and not an image as a cover

thanks a lot

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #172345 by JoomlaWorks
Replied by JoomlaWorks on topic using video as image in Category
Not directly. But this could make a nice feature for a future AllVideos Pro release :)

However local videos would require additional software on the server to extract some frame to use as K2 item image. YouTube videos can provide that preview frame from the YouTube API.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Маргарита Алаева
  • Маргарита Алаева's Avatar
  • Offline
  • New Member
More
3 years 11 months ago #175891 by Маргарита Алаева
Replied by Маргарита Алаева on topic using video as image in Category
I was looking for a Youtube solution and came up with a small chunk of code that works for me.
I had to disable video display in k2 category settings to make it work.

<?php
$video = $item->video;
$video = preg_replace('/\{[^}]+\}/', '', $video);
$v_thumb = 'i.ytimg.com/vi/' . $video . '/maxresdefault.jpg';
echo $v_thumb;
?>
<img src="<?php echo $v_thumb; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>" />

This will display the video thumbnail from youtube server.

Would've been great if you could add auto thumb generation for k2 article in the future versions.

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #175907 by JoomlaWorks
Replied by JoomlaWorks on topic using video as image in Category
This is part of AllVideos Pro actually :) Should be out within the coming months...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum