Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Media Player instead of link in Media Collections Box

Media Player instead of link in Media Collections Box

Locked

Views: 2,525

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
9 Mar 2010, 11:33 PM
#1
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Media Player instead of link in Media Collections Box

:frusty::lamo::cry:I have been working on this issue ALL DAY!! I went through just about every relevent thread, and no one has been able to find a solution to this.

HOW TO PUT A FLASH MP3 PLAYER IN PLACE OF THE LINK IN THE MEDIA COLLECTIONS BOX ON MUSIC PRODUCT PAGES!

Here's my problem...
How do I combine the following codes?
From: includes/templates/CUSTOM/templates/tpl_modules_media_manager.php

<div class="mediaTypeLink"><a href="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" target="_blank"><?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></a></div>

and: Sample Embed Code

<script type="text/javascript" src="http://site.com/storefront/swfobject.js"></script>
		
<div id="flashPlayer">
  This text will be replaced by the flash music player.
</div>

<script type="text/javascript">
   var so = new SWFObject("http://site.com/storefront/playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "no");
   so.addVariable("soundPath", "PATH TO MEDIA");
   so.write("flashPlayer");
</script>

I have tried everything I can think of to combine these to codes, but I'm not sure wich part of the first code calls the media, or which part of the first code I would replace to ONLY change the link text to be the player.

Any help would be GREATLY appreciated by me and MANY other people!

11 Mar 2010, 3:52 PM
#2
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

:lamo:Any ideas? I don't know what to do with this. Any help would be AWESOME!!!

12 Mar 2010, 3:03 PM
#3
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

This is what I have tried putting into my tpl_modules_media_manager.php file between the follwing codes:

<div class="rowWrapper">
      <div class="mediaTitle"><?php echo $za_media['text']; ?></div>
<?php
    $zv_counter1 = 0;
    while(list($za_clip_key, $za_clip) = each($za_media_manager[$za_media_key]['clips'])) {
?>

[I]AND[/I]

<div class="mediaTypeLink"><a href="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" target="_blank"><?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></a></div>

Here's my code attempt:

<html>
	<head>
	</head>
		<body>
<script type="text/javascript" src="/home/content/*/*/*/*****/html/Store_Front/includes/templates/CUSTOM/templates/swfobject.js"></script>
		
[I][B]<div id="flashPlayer">
  
</div>[/B][/I]

<script type="text/javascript">
   var so = new SWFObject("/home/content/*/*/*/*****/html/Store_Front/includes/templates/CUSTOM/templates/playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "no");
   so.addVariable("soundPath", "<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>");
   so.write("flashPlayer");
</script>
		</body>
</html>

When I "View Source" on a music-product-type page, this is what I get for this section:

<html>
	<head>
	</head>
		<body>
<script type="text/javascript" src="/home/content/*/*/*/*****/html/Store_Front/includes/templates/CUSTOM/templates/swfobject.js"></script>
		
<div id="flashPlayer">
  
</div>
 
<script type="text/javascript"> 
   var so = new SWFObject("/home/content/*/*/*/*****/html/Store_Front/includes/templates/CUSTOM/templates/playerSingle.swf", "mymovie", "192", "67", "7", "#FFFFFF");
   so.addVariable("autoPlay", "no");
   so.addVariable("soundPath", "http://www.perrymultimediaandcompany.com/sscents/media/Anarchy.mp3");
   so.write("flashPlayer");
</script>
		</body>
</html>

:wacko:Am I on the right track here? Do I need to do something different with the playerSingle.swf and swfobject.js files, like put them in the "media" folder where the music files are? I think I'm getting close, but the player doesn't show up.

:(If I put any text in the BOLD section of the tpl_... file (See above), the text shows up, but the player won't... I guess for now I could move this part: ```

<div class="mediaTypeLink"> ``` into the text section so people can still open the file with their default player...

:frusty::wacko:PLEASE HELP!!!!:frusty::wacko:

12 Mar 2010, 3:24 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

What is the purpose of the media player? Is it to play some song while people shop? Do you want it to start automatically?

Exactly WHERE must this player be evident?

A sidebox, the header, the main content page, the footer?

On one of my demo sites I've just embedded the odeo player into my product description.

12 Mar 2010, 4:02 PM
#5
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

schoolboy:

What is the purpose of the media player? Is it to play some song while people shop? Do you want it to start automatically?

Exactly WHERE must this player be evident?

A sidebox, the header, the main content page, the footer?

On one of my demo sites I've just embedded the odeo player into my product description.

  1. The media player will play the song(s) specified in the media manager for the product specified (I thought this would help simplify the process because then ZenCart users could just set up the songs and such in Admin > Extras > Media Manager). It has the same function as the media manager "demo song" link, but it plays in the window instead of downloading to the customers' default player. I do not want it to start automatically (some customers might not want to listen to it...).

  2. I want the player to be INSIDE the green "Media Collections:" box below the description. It is a single-song player, but there is a "Playlist" player that can be used in basically the same way. I just can't figure out why the "text" section shows up, but not the player...

12 Mar 2010, 5:22 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

I am not at all familiar with Media Manager, but my logic suggests there may be a way to do what you are after.

If you look at the relatively simple way of EMBEDDING a player into a HTML page:

<embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="275" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url=http://www.website-name.co.uk/folder-name/media/thehunter.mp3" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>

You will see that within this embedded "phrase" is the URL to the actual bit of media.

Now the tpl_modules_media_manager.php file has the capacity to call in that unique URL

... so if you can "wrap" that php into the above EMBED, then it should be possible...

I'll experiment a bit and see where this gets to...

12 Mar 2010, 5:32 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

Now this is a LONG SHOT as I really don't know what I'm doing here, but BACKUP YOUR tpl_modules_media_manager.php and try this one...

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_media_manager.php 5952 2007-03-03 06:18:46Z drbyte $
 */
/**
 * require module to aggregate media clips to an array
 */
  require(DIR_WS_MODULES . zen_get_module_directory('media_manager.php'));
  if ($zv_product_has_media) {
?>


<h2 id="mediaManagerHeading"><?php echo TEXT_PRODUCT_COLLECTIONS; ?></h2>

<?php
  while (list($za_media_key, $za_media) = each($za_media_manager)) {
?>
<div class="rowWrapper">
      <div class="mediaTitle"><?php echo $za_media['text']; ?></div>
<?php
    $zv_counter1 = 0;
    while(list($za_clip_key, $za_clip) = each($za_media_manager[$za_media_key]['clips'])) {
?>
      <div class="mediaTypeLink"><embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="275" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed></div>

<?php
    }
?>
    </div>
<?php
  }
  }
?>
12 Mar 2010, 5:47 PM
#8
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

Now this is a LONG SHOT as I really don't know what I'm doing here, but BACKUP YOUR tpl_modules_media_manager.php and try this one...

<?php /** * Module Template * * @package templateSystem * @copyright Copyright 2003-2007 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_modules_media_manager.php 5952 2007-03-03 06:18:46Z drbyte $ */ /** * require module to aggregate media clips to an array */ require(DIR_WS_MODULES . zen_get_module_directory('media_manager.php')); if ($zv_product_has_media) { ?> <h2 id="mediaManagerHeading"><?php echo TEXT_PRODUCT_COLLECTIONS; ?></h2> <?php while (list($za_media_key, $za_media) = each($za_media_manager)) { ?> <div class="rowWrapper"> <div class="mediaTitle"><?php echo $za_media['text']; ?></div> <?php $zv_counter1 = 0; while(list($za_clip_key, $za_clip) = each($za_media_manager[$za_media_key]['clips'])) { ?> <div class="mediaTypeLink"><embed src= "http://www.odeo.com/flash/audio_player_standard_gray.swf" quality="high" width="275" height="52" allowScriptAccess="always" wmode="transparent" type="application/x-shockwave-flash" flashvars= "valid_sample_rate=true&external_url="<?php echo zen_href_link(DIR_WS_MEDIA . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed></div> <?php } ?>
</div> 
<?php } } ?>
Well, I just tried the above suggestion, but it didn't work...
What you said before about the line of code: ```php
<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>

That part works for the URL info... it's just that the player isn't showing up! I'm pulling out my hair trying to get this to work...:cry:

12 Mar 2010, 5:52 PM
#9
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

schoolboy:

What is the purpose of the media player? Is it to play some song while people shop? Do you want it to start automatically?

Exactly WHERE must this player be evident?

A sidebox, the header, the main content page, the footer?

On one of my demo sites I've just embedded the odeo player into my product description.

I took a look at your demo site, and your media player doesn't show up for me, there's just a white box with a small "pic" icon in the corner, and there isn't alternative content. That's why I want to keep the link in the Media Collections box, but only have it show up if the Player doesn't load... just an idea for you.

12 Mar 2010, 5:55 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

flipperry:

I took a look at your demo site, and your media player doesn't show up for me, there's just a white box with a small "pic" icon in the corner, and there isn't alternative content. That's why I want to keep the link in the Media Collections box, but only have it show up if the Player doesn't load... just an idea for you.

Hmmm.... thanks.

What browser are you using? This works using the latest Firefox browser...

12 Mar 2010, 6:34 PM
#11
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

I'm Using IE8.........

I FIGURED IT OUT!!!!!!!!! I HAD THE FILES IN THE WRONG FOLDER!!!!!!!!!!!:shocking::D:clap::D:clap::D:clap:

12 Mar 2010, 6:36 PM
#12
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

I may come to you for your expertise on this... Well done.

Can I see the result?

12 Mar 2010, 6:40 PM
#13
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

schoolboy:

I may come to you for your expertise on this... Well done.

Can I see the result?

Click Here and go to any of the CDs' description pages, it should show up in the box below the description. (It would be good to have someone look at it from FireFox, so thank you!) If the player doesn't show up, then there should still be the link in the box that opens the song in your default player.

I will be making an add-on for this, I just have to get the files arranged and the install.txt file.........

Thank you for the help you offered.

12 Mar 2010, 7:28 PM
#14
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

Flip... this would be a very popular module. Thanks for submitting it to the Add-ons . I look forward to it.

I tested the link in FF and it works very nicely! great stuff.

12 Mar 2010, 7:33 PM
#15
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

Support Forum for Media Manager MP3 Player whenever it gets through the submission review process.

Thanks for your input!!!!!!

13 Mar 2010, 2:41 PM
#16
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Media Player instead of link in Media Collections Box

Click here to download the module "Media Manager MP3 Player"! You will have to go to Premium Beat's website to download the Single Track player, but you can go here for support!:D