southbeach
Programmer
Here is what I want to get done
except that it should be inside a layer container placed there via AJAX (I use XAJAX). For the life of me, no matter what I try, I cannot get the MP3 player to appear.
If you look at the code for the above link, you should find this block of code
You can learn more about this mp3 player here
I have tried everything I can think of and I just cannot get this thing to work via AJAX. I have tried writing the html code to disk and then loading the file back using include().
My most recent failed attempt is this
I get everything I want on the page except for the mp3 player next to the document to allow visitors listen to our sound tracks.
You may notice that I have resolved to looping through my sound track table to to push the required JS code to load the player on each of the set containers (trackID[NNNN]).
The UDF getResolved is simply this
It is my way of never having to remember something I learned here (thanks to jpadie!).
It is almost as if the object playonetrack.js is not loaded but it is ...
Please excuse the long post but I figure you may need as much information as possible to help with this one.
Thank you all in advance for your assistance!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
except that it should be inside a layer container placed there via AJAX (I use XAJAX). For the life of me, no matter what I try, I cannot get the MP3 player to appear.
If you look at the code for the above link, you should find this block of code
Code:
<div id="trackID0">Play it!</div>
<script type="text/javascript">
var so = new playonetrack("playonetrack.swf", "mymovie", "75", "30", "7", "#FFFFFF");
so.addVariable("autoPlay", "no");
so.addVariable("overColor","#660000");
so.addVariable("playerSkin","5")
so.addVariable("soundPath", "./media/soundtrack/song.mp3");
so.write("trackID0");
</script>
I have tried everything I can think of and I just cannot get this thing to work via AJAX. I have tried writing the html code to disk and then loading the file back using include().
My most recent failed attempt is this
Code:
case 'LZTRACKS':
$content = getResolved(APPINCLUDE.'lztracks.php');
$track = new track;
$tracklist = $track->listtracks(); $tempfile=uniqid('').'.htm';
$fopen=fopen($tempfile,"a+");
$fwrite=fwrite($fopen, $tracklist); $fclose=fclose($fopen);
$thelist = getResolved($tempfile); @unlink($tempfile);
//include($tempfile); echo $tempfile; @unlink($tempfile);
$objResponse = new xajaxResponse();
$objResponse->assign("content","innerHTML",$content);
$objResponse->assign("tracklist","innerHTML",$thelist);
$objResponse->assign("dumb","value",$thelist);
$sql = 'SELECT * FROM `lzsoundtrack` WHERE 1;';
$query=getQuery($sql);
while($row = mysql_fetch_assoc($query)) {
$objResponse->script('
<script type="text/javascript">
var so = new swfobject("playonetrack.swf", "track'.$row['id'].'", "75", "30", "7", "#FFFFFF");
so.addVariable("autoPlay", "no");
so.addVariable("overColor","#660000")
so.addVariable("soundPath", "./'.$row['trackfile'].'");
so.write("trackID'.$row['id'].'");
</script>');
}
return $objResponse;
break;
You may notice that I have resolved to looping through my sound track table to to push the required JS code to load the player on each of the set containers (trackID[NNNN]).
The UDF getResolved is simply this
Code:
function getResolved($page) {
ob_start();
include $page;
$content = ob_get_contents();
ob_end_clean();
return ($content);
}
It is almost as if the object playonetrack.js is not loaded but it is ...
Please excuse the long post but I figure you may need as much information as possible to help with this one.
Thank you all in advance for your assistance!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.