Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListPassing Variable to jPlayer jQuery Plugin?Passing Variable to jPlayer jQuery Plugin?
Previous
 
Next
New Post
2/25/2011 5:34 PM
 
Hi,
I have FnL currently with only one field (Column Name: "MP3") of Data Type DOWNLOAD.  The intention is to have MP3 files as records.  The MP3 is by default displayed as a list and one can click for "Details" to play the MP3 using jPlayer (a jQuery Plugin - http://www.jplayer.org/).

My problem is how to pass the "MP3_UDT_Url" as a parameter ("audioFile") for the jPlayer plugin.  Where and how can I implement it?

The jPlayer Plugin Interface has the following setup in XSL for the "Detail" Template:
=====================
  <xsl:template match="udt:Data" mode="detail">
    <xsl:call-template name="ListView" />
    <xsl:call-template name="EditLink" />
    <!-- jPlayer Interface BEGIN -->
    <div id="jquery_jplayer_1" class="jp-jplayer">
    </div>
    <div class="jp-audio">
      <div class="jp-type-single">
        <div id="jp_interface_1" class="jp-interface">
          <ul class="jp-controls">
            <li>
              <a href="#" class="jp-play" tabindex="1">play</a>
            </li>
            <li>
              <a href="#" class="jp-pause" tabindex="1">pause</a>
            </li>
            <li>
              <a href="#" class="jp-stop" tabindex="1">stop</a>
            </li>
            <li>
              <a href="#" class="jp-mute" tabindex="1">mute</a>
            </li>
            <li>
              <a href="#" class="jp-unmute" tabindex="1">unmute</a>
            </li>
          </ul>
          <div class="jp-progress">
            <div class="jp-seek-bar">
              <div class="jp-play-bar">
              </div>
            </div>
          </div>
          <div class="jp-volume-bar">
            <div class="jp-volume-bar-value">
            </div>
          </div>
          <div class="jp-current-time">
          </div>
          <div class="jp-duration">
          </div>
        </div>
        <div id="jp_playlist_1" class="jp-playlist">
          <ul>
            <li>
              <xsl:value-of select="udt:MP3" disable-output-escaping="yes" />
            </li>
          </ul>
        </div>
      </div>
    </div>
    <!-- jPlayer Interface END -->
    <table>
      <tr>
        <td class="normalBold">MP3</td>
        <td class="Normal">
          <xsl:value-of select="udt:MP3" disable-output-escaping="yes" />
        </td>
        <td class="Normal">
          <xsl:value-of select="udt:MP3_UDT_Url" disable-output-escaping="yes" />
        </td>
      </tr>
    </table>
  </xsl:template>
=====================

I call the jPlayer Plugin using an external script file called AudioPlayer.js that is declared on the <HEAD> tag from the Page Settings.  The variable "audioFile" should hold the "MP3_UDT_Url". 
=====================
(function($) {
  $(document).ready(function(){
   $("#jquery_jplayer_1").jPlayer({
   ready: function () {
   $(this).jPlayer("setMedia", {
   mp3: $("#audioFile").text()
   }).jPlayer("play");
   },
   ended: function (event) {
   $(this).jPlayer("play");
   },
   swfPath: "/Portals/0/jPlayer/",
   supplied: "mp3"
   });
  });
})(jQuery);
=====================

I tried putting the following before the "jPlayer Interface BEGIN".  This is to feed the external script AudioPlayer.js with the audioFile=MP3_UDT_Url. Problem is the jPlayer Interface is NOT showing up (NOT DISPLAYED).  I can hear the MP3 file play.
=====================
    <div id="audioFile" style="display:none;">
      <xsl:value-of select="udt:MP3_UDT_Url" disable-output-escaping="yes" />
    </div>
=====================

How can I get this thing run?  I would really appreciate some guidance here.
Test Site: http://ra-duran.net.cws6.my-hosting-p...

Thanks, Olan

 
New Post
3/2/2011 9:31 AM
 
Sorry Olan, I can't help here. I don't know jplayer, and I have no idea how to use / set it up.

Anyway, mp3_UDT_url is probably wrong, as this uses linkclick.aspx instead of direct file links. I would suggest using the URL datatype and an additional calculated column which uses mp3_UDT_Caption to set up a direct link to the file.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListPassing Variable to jPlayer jQuery Plugin?Passing Variable to jPlayer jQuery Plugin?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out