ziedinjsh Posted November 6, 2010 Report Share Posted November 6, 2010 Sveiki! Kā varētu uztaisīt tādu lietu kā: pie dziesmas nosaukuma ir play poga uzspiežot uz tās atskaņo mp3 failu un play pogas vietā parādas stop poga. satura lapā tas varētu izskatīties kaut kā šādi echo '<div class="song">'.player('song/demo.mp3').'</div>'; bet kāda tad ir jātaisa funkcija lai kaut ko tādu izvadītu un kāds man atskaņošanas kods vajadzīgs? Paldies jau iepriekš :) Quote Link to comment Share on other sites More sharing options...
Rincewind Posted November 6, 2010 Report Share Posted November 6, 2010 Guglis saka Dewplayer easiest mp3 flash player Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted November 6, 2010 Author Report Share Posted November 6, 2010 Paldies! Bet nu vai nu es neredzēju vai nebija licenze?! Tas tieks izmantots lapā kur iespējams apgrozīsies nauda Quote Link to comment Share on other sites More sharing options...
Rincewind Posted November 6, 2010 Report Share Posted November 6, 2010 Var lietot: Dewplayer is under Creative Commons licence. The usage is totally free even for commercial purposes (but not reselling it). Quote Link to comment Share on other sites More sharing options...
codez Posted November 6, 2010 Report Share Posted November 6, 2010 (edited) Var izmantot HTML5 JS API, tad <div class="song" onclick="snd=new Audio('song.mp3'); snd.play();">Play</div> Edited November 6, 2010 by codez Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted November 6, 2010 Author Report Share Posted November 6, 2010 Var izmantot HTML5 JS API, tad <div class="song" onclick="snd=new Audio('song.mp3'); snd.play();">Play</div> izmantojot šo man izmet parse erroru: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\WEB\xampp\htdocs\sell\misc\player.php on line 4 <?php function player(){ echo '<div class="song" onclick="snd=new Audio('song.mp3'); snd.play();">Play</div>'; } ?> Quote Link to comment Share on other sites More sharing options...
codez Posted November 6, 2010 Report Share Posted November 6, 2010 Tu neredzi iekrāsojumu, ka tev strings beidzas pie song.mp3, tāpēc apastrofu, kurš atdala song.mp3 vajag eskeipot, lai PHP to neuztver par stringa sākumu un beigām? echo '<div class="song" onclick="snd=new Audio(\'song.mp3\'); snd.play();">Play</div>'; Quote Link to comment Share on other sites More sharing options...
bubu Posted November 6, 2010 Report Share Posted November 6, 2010 $a = 'abc'def'ghi'; Kā lai tavuprāt php šajā stringā zin, kur sākas un kur beidzas strings? Tas vienkārši ņem pirmo pēdiņu - tur sākas, un pie nākamās neeskeipotās tādas pašas pēdiņas tas beidzas. Tātad $a = 'abc' Taču kas ir tas def'ghi' - to php vairs nesprot, tā ir sintaktiska kļūda. Tepat pat šī foruma sintakes krāsojums to perfekti parāda. Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted November 6, 2010 Author Report Share Posted November 6, 2010 (edited) Sapratu :) tagad izkstās šādi: function player(){ echo '<div class="song" onclick="snd=new Audio(\'demo/somewhere_is_something_demo.mp3\'); snd.play();"></div>'; } izvadās echo "".player().""; Tagad kā var uztaisīt šadu izvadi: echo "".player('demo/somewhere_is_something_demo.mp3').""; Lai nebūtu jātaisa jauna funkcija visu laiku pie katra nākamā mp3 faila :? Edited November 6, 2010 by ziedinjsh 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.