Thread Starter
choibc
(@choibc)
I fixed this issue like this.
$playerElementID = "audioplayer_" . ++$this->playerID;
if (strlen($this->options["flashAlternate"]) > 0) {
$playerCode = str_replace(array("%playerID%", "%downloadURL%"), array($playerElementID, $actualFile), $this->options["flashAlternate"]);
} else {
$playerCode = '<p class="audioplayer_container"><span style="display:block;padding:5px;border:1px solid #dddddd;background:#f8f8f8" id="' . $playerElementID . '">' . sprintf(__('Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version <a href="%s" title="Download Adobe Flash Player">here</a>. You also need to have JavaScript enabled in your browser.', $this->textDomain), 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW') . '</span></p>';
}
/* ajax issue; ANDY
$this->footerCode .= 'AudioPlayer.embed("' . $playerElementID . '", ' . $this->php2js($playerOptions) . ');';
$this->footerCode .= "\n";
*/
$playerCode .= '<script type="text/javascript">AudioPlayer.embed("' . $playerElementID . '", ' . $this->php2js($playerOptions) . ');</script>'
$playerCode .= "\n";
return $playerCode;
This is exactly what I needed! It works perfect. I too am using an ajax layout that dynamically loads posts with the audio player (tylerwolff.com).
Thank you!
Hey guys, this is giving me an error for the audio player.php file. Is there something I’m missing?
FIXXEDDD
Missing “;” at the end of this line:
$playerCode .= '<script type="text/javascript">AudioPlayer.embed("' . $playerElementID . '", ' . $this->php2js($playerOptions) . ');</script>';
Works perfectly. Thanks.