VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ex3mist on June 16, 2015, 10:19:17 AM

Title: Video among the images of the product
Post by: ex3mist on June 16, 2015, 10:19:17 AM
Hello,
I'd like to ask if anyone knows an extension that allows to insert a video among the product images? Not talking about putting video anywhere in the product details page, but among the images. An example could be seen here (http://www.immobilienscout24.de/expose/81901249?referrer=RESULT_LIST_LISTING&navigationServiceUrl=%2FSuche%2Fcontroller%2FexposeNavigation%2Fnavigate.go%3FsearchUrl%3D%2FSuche%2FS-4%2FP-2%2FHaus-Kauf%2FUmkreissuche%2FHochtaunuskreis%2F-%2F-96897%2F2255755%2FBad_20Homburg_20v_2e_20d_2e_20H_f6he%2F-%2F5%2F-%2F95%2C00-%26exposeId%3D81901249&navigationHasPrev=true&navigationHasNext=true&navigationBarType=RESULT_LIST&searchId=f18f9496-8762-372d-aa68-d29293d3ca86).
Title: Re: Video among the images of the product
Post by: PRO on June 16, 2015, 15:43:46 PM
I custom field "position" can be in the same place as the images.

what type of video?


youtube? or a custom upload?
Title: Re: Video among the images of the product
Post by: Studio 42 on June 17, 2015, 00:07:11 AM
Hi,
I have do it here in my shop:
http://shop.st42.fr/en/products/vm-be-pro-batch-product-edit.htm
I add the tags in the image title (XXXXX is the youtube ID):
youtube-XXXXXX for a simple youtube video
or youlist-XXXXXX for a youtube playlist
and added it in my overide templates/YOURTEMPLATE/html/com_virtuemart/productdetails/default_images.php

this is the php code i use:
if (!empty($this->product->images)) {

$image = $this->product->images[0];
if (substr($image->file_title,0,7) == 'youtube' ) {
$videoId = substr($image->file_title,8) ;
echo '<div class="embed-responsive embed-responsive-16by9">
<iframe  class="embed-responsive-item" src="https://www.youtube.com/embed/'.$videoId.'" frameborder="0" allowfullscreen></iframe></div>';
}
elseif (substr($image->file_title,0,7) == 'youlist' ) {
$videoId = substr($image->file_title,8) ;
echo '<div class="embed-responsive embed-responsive-16by9">
<iframe  class="embed-responsive-item" src="https://www.youtube.com/embed/videoseries?list='.$videoId.'&amp;showinfo=0" frameborder="0" allowfullscreen></iframe></div>';
}
else
{
// old code for image
?>
<div class="main-image">


Of course you have to add the CSS to fith your template
or add this : https://github.com/twbs/bootstrap/blob/master/less/responsive-embed.less for responsiveness for eg.

If you want play your own videos, then you have to add the javascript for it, for you tube this code work without any changes
Title: Re: Video among the images of the product
Post by: ex3mist on June 17, 2015, 08:05:22 AM
Thank you, Studio 42! That's what I meant.
But... Is there an option the video to be in the popup with the other images? So that it could be watched in bigger window. You can see the template I'm using and in the bottom right corner of the image there is an icon for opening it in popup: http://karateland.shumkarov.com/index.php/en/schuetzer/nahkampf-faustschutz-detail.html
I'd like the video to be in the popup "slideshow" too. Of course the zoom window won't work for it.
Title: Re: Video among the images of the product
Post by: Studio 42 on June 17, 2015, 09:42:34 AM
Hi,
I don't know the time to change the code and if this is possible with native facebox or fancybox.
Perhaps this need 1 or 2 hours or 10 minutes, i had already 30 minutes to find a simple solution for my case(i don't need to integrate the video in slide-show).
I think you understand that i cannot work on your project 2 hours for free but certainly someone answer a day and give you the solution.
Grreets,
Patrick
Title: Re: Video among the images of the product
Post by: ex3mist on June 20, 2015, 10:42:54 AM
OK, I understand. But if some payment is needed for this to be made, would you do it? If the price is reasonable I'm willing to pay for it, everyone deserves a payment for his job.