ziedinjsh Posted October 13, 2009 Report Share Posted October 13, 2009 Sveiki! Vai ir kaut kur dabonāms kaut kāds mp3 playeris ko ievietot iekš portāla kurš mp3 failus lasa no norādīta foldera? Maiģināju JW playeri ar to playlist ko ģenerē php, bet nekā neizdevās.. varb;ut ie kāds parasts playeris kur uzreiz lasa no kāda foldera parāda arī playlist? Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 Man liekas, ka mēģini tomēr pacīnīties ar JW atskaņotāju, jo tam nu toč nav ne vainas! Nekam sarežģītam tur nevajadzētu būt, vismaz izlasīji pamācību kā uzstādīt?? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 it kā jā, bet nu nekā nesanākk.. iesākumā es nemaz nevaru atrast to playlist generator Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 it kā jā, bet nu nekā nesanākk.. iesākumā es nemaz nevaru atrast to playlist generator Nu bītītmatos :) meklē labāk! Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 nesanāk labāk! :D Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 nesanāk labāk! :D A viņus mājaslapā vispār skatījies? Tur noteikti ir dokumentācija ar lietošaans paraugiem. Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 skatījos, jā. Tur ir topiki kur ir ķipa gatavs scripts, bet ieejot viņa tur tikai var redzēt pateicīgas atbildes.. kkādi daži ir peejami arī, bet citiem viņi iet, bet man nē! Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 skatījos, jā. Tur ir topiki kur ir ķipa gatavs scripts, bet ieejot viņa tur tikai var redzēt pateicīgas atbildes.. kkādi daži ir peejami arī, bet citiem viņi iet, bet man nē! Tad meklē problēmu, kāpēc neiet. Kādi paziņojumi rādās, kāda php versijas. Varbūt tev nemaz nav php? :)) Quote Link to comment Share on other sites More sharing options...
marcis Posted October 13, 2009 Report Share Posted October 13, 2009 Šis gan tev neko nedos (ja pat playlisti nevari uzģenerēt), bet vispār šis ir interesants un pateicīgs risinājums http://www.happyworm.com/jquery/jplayer/ Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 (edited) Tātad php ir šāds: <?php $dir = "upload/uploads"; $dh = opendir($dir); while (($file = readdir($dh)) !== false) { if($file != '.' && $file !='..'){ $string = "$file"; $new_string = preg_replace("/[^a-zA-Z0-9-.()\s]/", " ", $string); $new_string = str_replace(".mp3", " ", $new_string); if (isset($_GET['playlist'])) { echo ' <?xml version="1.0" encoding="UTF-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/"> <trackList>'; while (false !== ($file = readdir($dir))) { if($file!='.' && $file!='..' && $file!='index.php') { echo "<track>"; echo "<title>".$file."</title>"; echo "<location>".$dir."/".$file."</location>"; echo "</track>"; } } echo '</tracklist>'; exit(); } playera kods: echo'<center> <embed src="/misc/player.swf" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowfullscreen="false" flashvars="file=index.php?playlist& showdigits=true& playlistsize="20" width="510" height="404" > </center>'; playlist izvada: Warning: readdir(): supplied argument is not a valid Directory resource in /home/produc/public_html/mp3/index.php on line 51 un playeris rāda: This playlist is not a vaild XML File Edited October 13, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 Un kur ir problēma? flashvars="file=[Te norādi ceļu uz to php failu, ko pats devi augšpuse] Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 tajā php daļā ir gan kods kas lasa no foldera un rāda lapā un arī playlist generator.. tas viss atrodas index.php un playeris arī ir index.php playerī man ir norādīts flashvars="file=index.php?playlist Bet nu kā jau rakstīt.. playlist man rāda worning un playeris saka, ka nav xml fails Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 tajā php daļā ir gan kods kas lasa no foldera un rāda lapā un arī playlist generator.. tas viss atrodas index.php un playeris arī ir index.php playerī man ir norādīts flashvars="file=index.php?playlist Bet nu kā jau rakstīt.. playlist man rāda worning un playeris saka, ka nav xml fails Tad iznes to xml veidotāju ārpus tā index faila uz citu, vai ta tas tik grūti? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted October 13, 2009 Author Report Share Posted October 13, 2009 labi.. izdar;iju tā.. playlist.php: <?php echo '<?xml version="1.0" encoding="UTF-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/"> <trackList>'; $dir = opendir("upload/uploads"); while (false !== ($file = readdir($dir))) { if($file!='.' && $file!='..' && $file!='index.php') { echo "<track> <title>".$file."</title> <location>upload/uploads/".$file."</location> </track>"; } } echo '</tracklist>'; closedir($dir); ?> atverot playlist.php rādās upload/uploads/iremember.mp3 upload/uploads/in wild.mp3 utt bet playeris turpina rādīt to pāsu kļudu Quote Link to comment Share on other sites More sharing options...
briedis Posted October 13, 2009 Report Share Posted October 13, 2009 A tu pamainīji pleijera kodu? kur tiek norādīts ceļš uz to xml.. ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.