I have a grid where users can click on a product record and hear an audio clip using jplayer javascript.
It works fine, but I’m trying to figure out how to do something. I have about 50 different products, each
with a different title, mp3, and poster…please see in green below. I would like to pass a variable, depending
on which product the user clicks on, instead of having this information hard coded. The below script is in
a blank SC app that I call when the user clicks. Hopefully, there is an easy way to do this and thanks for
any ideas!
<script type=“text/javascript”>
//<![CDATA[
$(document).ready(function(){
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title:"Men's Professional - 1st half",
mp3:"../media/bu111.mp3",
poster: "../media/pro.set.10pct.jpg"
},
{
title:"Men's Professional - Half Time",
mp3:"http://www.jplayer.org/audio/mp3/TSP-05-Your_face.mp3",
poster: "../10pct/pro.set.10pct.jpg"
},
{
title:"Men's Professional - 2nd half",
mp3:"http://www.jplayer.org/audio/mp3/Miaow-02-Hidden.mp3",
poster: "../10pct/pro.set.10pct.jpg"
}
], {
swfPath: "../../dist/jplayer",
supplied: "webmv, ogv, m4v, oga, mp3",
useStateClassSkin: true,
autoBlur: false,
smoothPlayBar: true,
keyEnabled: true,
audioFullScreen: true
});
});
//]]>
</script>