Guest Posted December 7, 2004 Posted December 7, 2004 Hi, I was just wondering if anyone has found a solution for adding a short (up to 3) video clips (AVI,ASF,...) to a product. :o I was looking for mod that would display like 3 titles of clips (linkable) when you click on a small picture besides the product description. For ex. if I was selling DVDs..: I would have a description and besides the normal picture of DVD case and when I would click on it (like it would open big picture) I would get a list of available clips for short preview. It is basicaly a mod where I would be able to upload anything (and not just pics) in addition to product description - I would just upload AVI or MOV or ASF or DIVX clips... Many thanks for your support :thumbsup:
Guest Posted December 7, 2004 Posted December 7, 2004 This is what I changed in the product_info.php: <script language="javascript"><!--document.write('<?php $imagefile =? $product_info['products_image']; $videofile = DIR_WS_IMAGES . str_replace('.jpg','_large.wmv', $imagefile); if (file_exists($videofile)) echo '<a href="java script:popupWindow(\\\'' . tep_href_link('popup_demo_large.php', 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; else echo '<a href="java script:popupWindow(\\\'' . tep_href_link('popup_demo.php', 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>';?>'); //--></script> <noscript> <?php $imagefile =? $product_info['products_image']; $videofile = DIR_WS_IMAGES . str_replace('.jpg','_large.wmv', $imagefile); if (file_exists($videofile)) { ? echo '<a href="' . tep_href_link($videofile) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; } else { ? $videofile = DIR_WS_IMAGES . str_replace('.jpg','.wmv', $imagefile); ? if (file_exists($videofile)) ? { ? echo '<a href="' . tep_href_link($videofile) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ? } } ?> </noscript><br> <script language="javascript"><!-- document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_LARGE_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . TEXT_MORE_INFORMATION . '</a>'; ?>'); //--></script> <noscript> <?php $videofile =? $product_info['products_image']; $videofile =str_replace('.jpg','_large.jpg', $videofile); echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $videofile) . '" target="_blank">' . TEXT_MORE_INFORMATION . '</a>'; ?> </noscript> I use WMV though. But you need also add a video demo popup php file: <?php/* ? $Id: popup_demo_large.php,v 1.18 2004/07/05 23:26:23 hpdl Exp $ modified based on popup_image.php,v 1.18 2003/06/05 23:26:23 by www.3dtime.com ? osCommerce, Open Source E-Commerce Solutions ? http://www.oscommerce.com ? Copyright ? 2003 osCommerce ? Released under the GNU General Public License */ ? require('includes/application_top.php'); ? $navigation->remove_current_page(); ? $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'"); ? $products = tep_db_fetch_array($products_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo $products['products_name']; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <script language="javascript"><!-- var i=0; function resize() { ? if (navigator.appName == 'Netscape') i=40; ? //if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i); ? window.resizeTo(372, 342); ? self.focus(); } //--></script> </head> <body LEFTMARGIN=0 TOPMARGIN=0 onload="resize();"> <?php // The HTML image wrapper function ? function tep_demo_window($src, $alt = '', $width = '', $height = '', $parameters = '') { ? ? if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) { ? ? ? return false; ? ? } $videfile = str_replace('.jpg','_large.wmv', $src); // alt is added to the img tag even if it is null to prevent browsers from outputting // the image filename as default ? ? $image = '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="MediaPlayer1" width="352" height="284" align="middle" style="border-style: solid; border-color: #DCECFF; background-color: #DCECFF"> ? ? ? <param name="AudioStream" value="-1"> ? ? ? ? ? ? ? ? ? <param name="AutoSize" value="0"> ? ? ? ? ? ? ? ? ? <param name="AutoStart" value="1"> ? ? ? ? ? ? ? ? ? <param name="AnimationAtStart" value="1"> ? ? ? ? ? ? ? ? ? <param name="AllowScan" value="-1"> ? ? ? ? ? ? ? ? ? <param name="AllowChangeDisplaySize" value="-1"> ? ? ? ? ? ? ? ? ? <param name="AutoRewind" value="1"> ? ? ? ? ? ? ? ? ? <param name="Balance" value="0"> ? ? ? ? ? ? ? ? ? <param name="BaseURL" value> ? ? ? ? ? ? ? ? ? <param name="BufferingTime" value="5"> ? ? ? ? ? ? ? ? ? <param name="CaptioningID" value> ? ? ? ? ? ? ? ? ? <param name="ClickToPlay" value="-1"> ? ? ? ? ? ? ? ? ? <param name="CursorType" value="0"> ? ? ? ? ? ? ? ? ? <param name="CurrentPosition" value="-1"> ? ? ? ? ? ? ? ? ? <param name="CurrentMarker" value="0"> ? ? ? ? ? ? ? ? ? <param name="DefaultFrame" value> ? ? ? ? ? ? ? ? ? <param name="DisplayBackColor" value="0"> ? ? ? ? ? ? ? ? ? <param name="DisplayForeColor" value="16777215"> ? ? ? ? ? ? ? ? ? <param name="DisplayMode" value="0"> ? ? ? ? ? ? ? ? ? <param name="DisplaySize" value="0"> ? ? ? ? ? ? ? ? ? <param name="Enabled" value="-1"> ? ? ? ? ? ? ? ? ? <param name="EnableContextMenu" value="-1"> ? ? ? ? ? ? ? ? ? <param name="EnablePositionControls" value="-1"> ? ? ? ? ? ? ? ? ? <param name="EnableFullScreenControls" value="0"> ? ? ? ? ? ? ? ? ? <param name="EnableTracker" value="-1"> ? ? ? ? ? ? ? ? ? <param name="Filename" valuetype="ref" ref value="' . tep_output_string($videfile) . '">' . ? ? ? ? ? ? ? ? ? '<param name="InvokeURLs" value="-1"> ? ? ? ? ? ? ? ? ? <param name="Language" value="-1"> ? ? ? ? ? ? ? ? ? <param name="Mute" value="0"> ? ? ? ? ? ? ? ? ? <param name="PlayCount" value="100"> ? ? ? ? ? ? ? ? ? <param name="PreviewMode" value="0"> ? ? ? ? ? ? ? ? ? <param name="Rate" value="1"> ? ? ? ? ? ? ? ? ? <param name="SAMILang" value> ? ? ? ? ? ? ? ? ? <param name="SAMIStyle" value> ? ? ? ? ? ? ? ? ? <param name="SAMIFileName" value> ? ? ? ? ? ? ? ? ? <param name="SelectionStart" value="-1"> ? ? ? ? ? ? ? ? ? <param name="SelectionEnd" value="-1"> ? ? ? ? ? ? ? ? ? <param name="SendOpenStateChangeEvents" value="-1"> ? ? ? ? ? ? ? ? ? <param name="SendWarningEvents" value="-1"> ? ? ? ? ? ? ? ? ? <param name="SendErrorEvents" value="-1"> ? ? ? ? ? ? ? ? ? <param name="SendKeyboardEvents" value="0"> ? ? ? ? ? ? ? ? ? <param name="SendMouseClickEvents" value="0"> ? ? ? ? ? ? ? ? ? <param name="SendMouseMoveEvents" value="0"> ? ? ? ? ? ? ? ? ? <param name="SendPlayStateChangeEvents" value="-1"> ? ? ? ? ? ? ? ? ? <param name="ShowCaptioning" value="0"> ? ? ? ? ? ? ? ? ? <param name="ShowControls" value="-1"> ? ? ? ? ? ? ? ? ? <param name="ShowAudioControls" value="-1"> ? ? ? ? ? ? ? ? ? <param name="ShowDisplay" value="0"> ? ? ? ? ? ? ? ? ? <param name="ShowGotoBar" value="0"> ? ? ? ? ? ? ? ? ? <param name="ShowPositionControls" value="-1"> ? ? ? ? ? ? ? ? ? <param name="ShowStatusBar" value="0"> ? ? ? ? ? ? ? ? ? <param name="ShowTracker" value="-1"> ? ? ? ? ? ? ? ? ? <param name="TransparentAtStart" value="0"> ? ? ? ? ? ? ? ? ? <param name="VideoBorderWidth" value="0"> ? ? ? ? ? ? ? ? ? <param name="VideoBorderColor" value="0"> ? ? ? ? ? ? ? ? ? <param name="VideoBorder3D" value="0"> ? ? ? ? ? ? ? ? ? <param name="Volume" value="-600"> ? ? ? ? ? ? ? ? ? <param name="WindowlessVideo" value="0"> ? ? ? ? ? ? ? ? </object>'; /* ? ? if (tep_not_null($alt)) { ? ? ? $image .= ' title=" ' . tep_output_string($alt) . ' "'; ? ? } ? ? if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) { ? ? ? if ($image_size = @getimagesize($src)) { ? ? ? ? if (empty($width) && tep_not_null($height)) { ? ? ? ? ? $ratio = $height / $image_size[1]; ? ? ? ? ? $width = $image_size[0] * $ratio; ? ? ? ? } elseif (tep_not_null($width) && empty($height)) { ? ? ? ? ? $ratio = $width / $image_size[0]; ? ? ? ? ? $height = $image_size[1] * $ratio; ? ? ? ? } elseif (empty($width) && empty($height)) { ? ? ? ? ? $width = $image_size[0]; ? ? ? ? ? $height = $image_size[1]; ? ? ? ? } ? ? ? } elseif (IMAGE_REQUIRED == 'false') { ? ? ? ? return false; ? ? ? } ? ? } ? ? if (tep_not_null($width) && tep_not_null($height)) { ? ? ? $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"'; ? ? } ? ? if (tep_not_null($parameters)) $image .= ' ' . $parameters; ? ? $image .= '>'; */ ? ? return $image; ? } echo tep_demo_window(DIR_WS_IMAGES . $products['products_image'], $products['products_name']); ?> </body> </html> <?php require('includes/application_bottom.php'); ?>
Guest Posted December 7, 2004 Posted December 7, 2004 Gee... That was fast !!! Many thanks :thumbsup: :thumbsup: Will try it ! WMV or AVI or etc - it does not make any difference B) Owe you one !!
Guest Posted December 7, 2004 Posted December 7, 2004 This is what I changed in the product_info.php:I use WMV though. But you need also add a video demo popup php file: <{POST_SNAPBACK}> Ok did it!! and it displays a video but the picture is gone! I was trying to have it both - like with description there would be a picture and when you click on it it will display video... So therefore I think you need to have a 2 upload fields in Categories (admin) where you edit or add new product... Did you manage to deal with it too? Thanks for help!! Best regards!
Guest Posted December 8, 2004 Posted December 8, 2004 There are two links under the thumbnail. The first link is the video and the second one is to the large image. Take a look at my web site: http://www.3dtime.com I did not add a new entry in the admin. Just play the file name trick. The video file name uses the same image file name except for the extension. So only the image file name is required to be added in the product database.
Guest Posted February 9, 2005 Posted February 9, 2005 Hi James I've been reading the thread .. and after a bit of struggling due to my newbie status, got it to work :-) I cannot get it to work with firefox however.. I understand that firefox requires the <embed> commant and have seen this code as being perported to work. <embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/Mediaplayer/" id="player" name="" value=" " width="250" height="240" autostart="false"> </embed> </object> I believe it needs to be passed the name and value parameters but I cannot make it work :-( (again a newbie) would you have any ideas?? ps.. when I open your site and try to view your videos in IE6 and Firefox - they both are asking if I want to dowload the file or open it... it was playing fine at my work machine but not on this one that as a latter version of ie installed Best regards, Paul There are two links under the thumbnail. The first link is the video and the second one is to the large image. Take a look at my web site: http://www.3dtime.com I did not add a new entry in the admin. Just play the file name trick. The video file name uses the same image file name except for the extension. So only the image file name is required to be added in the product database. <{POST_SNAPBACK}>
wdevn Posted April 16, 2006 Posted April 16, 2006 This is what I changed in the product_info.php:I use WMV though. But you need also add a video demo popup php file: Hello everyone! I've added the scripts fine and I can see the image. However, I can't see the video I've uploaded. The video is namesed "tot.wmv" and the image is "tot.jpg." They are in the same directory. I thought the script would take the unique image name and change the .jpg to .wmv to show the video. What am I doing worng...thanks a lot!
srober Posted October 7, 2006 Posted October 7, 2006 Talk about bump lol. The majority of my site will not need a video. There is only a handfull of products that I need a streaming video option. Is there a work around so I dont have the view demo on every product description? Is there a better approach for what I require? I cant believe there is not contribution out there for this :P The only one I found semi works but none of my wmv files will convert to flv with any encoders I have tried. http://www.oscommerce.com/community/contri...ll/search,video
Guest Posted January 12, 2007 Posted January 12, 2007 Has anyone had any luck with this? http://www.oscommerce.com/community/contributions,4415
Recommended Posts
Archived
This topic is now archived and is closed to further replies.