{"id":178847,"date":"2013-05-06T11:51:04","date_gmt":"2013-05-06T07:51:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=178847"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=178847","title":{"rendered":"<span class=\"post_title\">\u0410\u0443\u0434\u0438\u043e\u043f\u043b\u0435\u0435\u0440 \u0441 \u043f\u043b\u0435\u0439\u043b\u0438\u0441\u0442\u043e\u043c \u043d\u0430 HTML5<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0425\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435.<\/p>\n<p>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u0432 JavaScript \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e\u043f\u043b\u0435\u0435\u0440. \u041a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u043c, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043c \u0441 \u0432\u0430\u043c\u0438. \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0432\u0430\u0442\u043e \u0441 \u043c\u043e\u0438\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 js \u0438 jQuery. \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c \u043f\u043b\u0435\u0435\u0440.<\/p>\n<p>  1. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 music  <\/p>\n<pre><code class=\"php\">&lt;?php  $files = glob('music\/*'); ?&gt; <\/code><\/pre>\n<p>  2. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 jQuery \u0438 jQuery UI (\u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430), \u0430 \u0442\u0430\u043a \u0436\u0435 \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b bootstrap \u0438\u043a\u043e\u043d\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043c\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443.<br \/>  <a name=\"habracut\"><\/a><br \/>  3. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u043e \u043a\u0443\u0441\u043e\u0447\u043a\u0430\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0446\u0438\u043a\u043b for \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"php\">&lt;?php for($i=0;$i&lt;count($files);$i++){ \t\t\t$name=explode(&quot;\/&quot;,$files[$i]); \t\t\t$name=$name[count($name)-1]; \t\t\t$ogg=explode(&quot;.og&quot;,$name); \t\t\t$name=explode(&quot;.mp3&quot;,$name); \t\t\t$name=$name[0]; \t\t\t$oggname=explode(&quot;.mp3&quot;,$files[$i]); \t\t\t$oggname=$oggname[0].&quot;.ogg&quot;; \t\t\tif($ogg[1]==&quot;g&quot;){ \t\t\t$files[$i]=null; \t\t\t} \t\t\tif($files[$i]!=null){ ?&gt; ...\u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 \u043f\u043b\u0435\u0435\u0440... &lt;?php }?&gt; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e $ogg \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0435\u0439\u043b\u0438\u0441\u0442 \u043f\u043e\u043c\u0438\u043c\u043e \u0444\u0430\u0439\u043b\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 .mp3 \u0435\u0449\u0451 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 .ogg.<\/p>\n<p>  4. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u0433  \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"php\">&lt;div style=&quot;width:440px;&quot;&gt;&lt;?=$name;?&gt; \t&lt;audio id=&quot;audio_&lt;?=$i;?&gt;&quot; tabindex=&quot;0&quot;&gt; \t\t&lt;source src=&quot;&lt;?=$files[$i];?&gt;&quot;&gt; \t\t&lt;?php if($files[$i-1]==null){?&gt; \t\t        &lt;source src=&quot;&lt;?=$oggname;?&gt;&quot;&gt; \t\t&lt;?php }?&gt; \t\t&lt;p&gt;\u0412\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 HTML5 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u043e\u0437\u0430\u043f\u0438\u0441\u0438&lt;\/p&gt; \t&lt;\/audio&gt; \t&lt;table style=&quot;width:440px;&quot;&gt; \t\t&lt;tr&gt; \t\t\t&lt;td style=&quot;width:40px;&quot;&gt; \t\t\t\t&lt;i class=&quot;icon-play&quot; onclick=&quot;play(&lt;?=$i;?&gt;);&quot; id=&quot;play_&lt;?=$i;?&gt;&quot;&gt;&lt;\/i&gt; \t\t\t\t&lt;i class=&quot;icon-stop&quot; onclick=&quot;stop(&lt;?=$i;?&gt;);&quot; id=&quot;stop_&lt;?=$i;?&gt;&quot;&gt;&lt;\/i&gt; \t\t\t&lt;\/td&gt; \t\t\t&lt;td style=&quot;width:300px&quot;&gt; \t\t\t\t&lt;div id=&quot;slider_&lt;?=$i;?&gt;&quot; style=&quot;margin-left:5px;&quot;&gt;&lt;\/div&gt; \t\t\t&lt;\/td&gt; \t\t\t&lt;td style=&quot;width:40px;&quot;&gt; \t\t\t\t&lt;div class=&quot;muted&quot; style=&quot;font-size:9px;&quot;&gt;&nbsp;&nbsp; \t\t\t\t\t&lt;span id=&quot;currentTime_&lt;?=$i;?&gt;&quot;&gt;&lt;\/span&gt; \t\t\t\t\t&lt;span id=&quot;totalTime_&lt;?=$i;?&gt;&quot;&gt;&lt;\/span&gt; \t\t\t\t&lt;\/div &gt; \t\t\t&lt;\/td&gt; \t\t\t&lt;td style=&quot;width:80px&quot;&gt; \t\t\t\t&lt;div id=&quot;slider-vol_&lt;?=$i;?&gt;&quot; style=&quot;margin-left:5px;&quot;&gt;&lt;\/div&gt; \t\t\t\t&lt;\/td&gt; \t\t\t\t&lt;td style=&quot;width:20px;&quot;&gt; \t\t\t\t\t&lt;div class=&quot;muted&quot; style=&quot;font-size:9px;&quot;&gt;&nbsp;&nbsp;&lt;span id=&quot;vol_&lt;?=$i;?&gt;&quot;&gt;&lt;\/span&gt;&lt;\/div &gt; \t\t\t\t&lt;\/td&gt; \t\t&lt;\/tr&gt; \t&lt;\/table&gt; \t&lt;hr&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c\u0443 \u0442\u0440\u0435\u043a\u0443 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f id `audio_&lt;?=$i;?&gt;` \u0438 \u0442\u0440\u0435\u043a \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 onclick=\u00abplay(&lt;?=$i;?&gt;);\u00bb. \u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f id slider_&lt;?=$i;?&gt;, \u0438 \u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f id vol_&lt;?=$i;?&gt;.<\/p>\n<p>  5. \u0418 \u0432\u043e\u0442 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043a\u043e\u0434 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u043b\u0435\u0435\u0440\u0430  <\/p>\n<pre><code class=\"javascript\">var id; var p=0; var curT=0; var vol=70; function play(id){ \t$('audio').get(0).pause(); \t$('#audio_'+id).get(0).volume=vol\/100; \t$(&quot;.icon-pause&quot;).addClass(&quot;icon-play&quot;).removeClass(&quot;icon-pause&quot;); \tif(p==0){ \t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-play&quot;).addClass(&quot;icon-pause&quot;); \t\t$('#currentTime_'+id).html($('#audio_'+id).get(0).play()); \t\tp=1; \t}else{ \t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-pause&quot;).addClass(&quot;icon-play&quot;); \t\t$('#currentTime_'+id).html($('#audio_'+id).get(0).pause()); \t\tp=0; \t} \tvar interval = setInterval(function(){ \t \tif(!isNaN(Math.round($('#audio_'+id).get(0).currentTime))){ \t\tvar s=Math.round($('#audio_'+id).get(0).currentTime); \t\tvar d = (s-(s%86400))\/86400; \t\tvar h = ((s-d*86400)-(s-d*86400)%3600)\/3600; \t\tif(h&lt;=9){h=&quot;0&quot;+h;} \t\tvar m = ((s-(s%60))-(d*86400+h*3600))\/60; \t\tif(m&lt;=9){m=&quot;0&quot;+m;} \t\tvar s = (s-(d*86400+h*3600+m*60)); \t\tif(s&lt;=9){s=&quot;0&quot;+s;} \t} \t\t$('#currentTime_'+id).html(m+&quot;:&quot;+s+&quot;\/&quot;); \tif(!isNaN(Math.round($('#audio_'+id).get(0).duration))){ \t\tvar s=Math.round($('#audio_'+id).get(0).duration); \t\tvar d = (s-(s%86400))\/86400; \t\tvar h = ((s-d*86400)-(s-d*86400)%3600)\/3600; \t\tif(h&lt;=9){h=&quot;0&quot;+h;} \t\tvar m = ((s-(s%60))-(d*86400+h*3600))\/60; \t\tif(m&lt;=9){m=&quot;0&quot;+m;} \t\tvar s = (s-(d*86400+h*3600+m*60)); \t\tif(s&lt;=9){s=&quot;0&quot;+s;} \t} \t\t$('#totalTime_'+id).html(m+&quot;:&quot;+s);  \t\t$( &quot;#slider_&quot;+id ).slider({ \t\t\trange: &quot;min&quot;, \t\t\tmin: 0, \t\t\tmax: $('#audio_'+id).get(0).duration, \t\t\tvalue: 0, \t\t\tslide: function( event, ui ) { \t\t\t\t$('#audio_'+id).get(0).currentTime=ui.value; \t\t\t} \t\t}); \t\t$( &quot;#slider-vol_&quot;+id ).slider({ \t\t\trange: &quot;min&quot;, \t\t\tmin: 0, \t\t\tmax: 100, \t\t\tvalue: $('#audio_'+id).get(0).volume*100, \t\t\tslide: function( event, ui ) { \t\t\t\t$( &quot;#vol_&quot;+id ).html( ui.value+&quot;%&quot; ); \t\t\t\t$('#audio_'+id).get(0).volume=(ui.value\/100); \t\t\t} \t\t}); \t\tvol=Math.round($('#audio_'+id).get(0).volume*100); \t\t$( &quot;#vol_&quot;+id ).html( vol+&quot;%&quot; ); \t\tvar width=eval($('#audio_'+id).get(0).currentTime\/$('#audio_'+id).get(0).duration*100); \t\t$(&quot;#slider_&quot;+id).find(&quot;.ui-slider-range&quot;).css(&quot;width&quot;,width+&quot;%&quot;); \t\t$(&quot;#slider_&quot;+id).find(&quot;.ui-slider-handle&quot;).css(&quot;left&quot;,width+&quot;%&quot;); \t\tcurT=Math.round($('#audio_'+id).get(0).currentTime); \t\tif(width==100){ \t\t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-pause&quot;).addClass(&quot;icon-play&quot;); \t\t\tp=0; \t\t\tplay(id+1); \t\t\tclearInterval( interval ); \t\t\twidth=0; \t\t} \t},400); } function stop(idd){ \t$('#currentTime_'+idd).html(&quot;0\/&quot;); \t$('#audio_'+idd).get(0).currentTime=0; \t$(&quot;#play_&quot;+idd).removeClass(&quot;icon-pause&quot;).removeClass(&quot;icon-play&quot;).addClass(&quot;icon-play&quot;); \tp=0; } <\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434<br \/>  <code>function play(id)<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u043a\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c id  <\/p>\n<pre><code class=\"javascript\">\t$('audio').get(0).pause(); \t$('#audio_'+id).get(0).volume=vol\/100; \t$(&quot;.icon-pause&quot;).addClass(&quot;icon-play&quot;).removeClass(&quot;icon-pause&quot;); \tif(p==0){ \t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-play&quot;).addClass(&quot;icon-pause&quot;); \t\t$('#currentTime_'+id).html($('#audio_'+id).get(0).play()); \t\tp=1; \t}else{ \t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-pause&quot;).addClass(&quot;icon-play&quot;); \t\t$('#currentTime_'+id).html($('#audio_'+id).get(0).pause()); \t\tp=0; \t} <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0441\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u0440\u0435\u043a\u0438 \u043d\u0430 \u043f\u0430\u0443\u0437\u0443, \u0437\u0430\u0434\u0430\u0451\u043c \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0435\u043a\u0443 \u0442\u0443 \u0436\u0435, \u0447\u0442\u043e \u0431\u044b\u043b\u0430 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u043a\u0430 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0431\u044b\u043b\u043e \u0442\u043e \u0431\u0435\u0440\u0451\u043c \u0438\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 vol = 70;), \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u043a\u043e\u043d\u043a\u0443 \u043f\u0440\u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\/\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u043f\u0430\u0443\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0440\u0435\u043a.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u0451\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b <code>var interval = setInterval(function(){<\/code> \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0440\u0435\u043a\u0430 \u0438\u0437 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432 \u043c\u0438\u043d\u0443\u0442\u044b, \u0447\u0430\u0441\u044b\u2026 (\u043a\u043e\u0434 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u0432\u0430\u0436\u0434\u044b)  <\/p>\n<pre><code class=\"javascript\">\tif(!isNaN(Math.round($('#audio_'+id).get(0).currentTime))){ \t\tvar s=Math.round($('#audio_'+id).get(0).currentTime); \t\tvar d = (s-(s%86400))\/86400; \t\tvar h = ((s-d*86400)-(s-d*86400)%3600)\/3600; \t\tif(h&lt;=9){h=&quot;0&quot;+h;} \t\tvar m = ((s-(s%60))-(d*86400+h*3600))\/60; \t\tif(m&lt;=9){m=&quot;0&quot;+m;} \t\tvar s = (s-(d*86400+h*3600+m*60)); \t\tif(s&lt;=9){s=&quot;0&quot;+s;} \t} <\/code><\/pre>\n<p>  \u0438 \u0437\u0430\u0434\u0430\u0451\u043c \u043d\u0430\u0448\u0438\u043c div&#8217;\u0430\u043c \u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <code>$('#currentTime_'+id).html(m+&quot;:&quot;+s+&quot;\/&quot;);<\/code> \u0438 \u043e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f <code>$('#totalTime_'+id).html(m+&quot;:&quot;+s); <\/code> \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u044b  <\/p>\n<pre><code class=\"javascript\">\t\t$( &quot;#slider_&quot;+id ).slider({ \t\t\trange: &quot;min&quot;, \t\t\tmin: 0, \t\t\tmax: $('#audio_'+id).get(0).duration, \t\t\tvalue: 0, \t\t\tslide: function( event, ui ) { \t\t\t\t$('#audio_'+id).get(0).currentTime=ui.value; \t\t\t} \t\t}); \t\t$( &quot;#slider-vol_&quot;+id ).slider({ \t\t\trange: &quot;min&quot;, \t\t\tmin: 0, \t\t\tmax: 100, \t\t\tvalue: $('#audio_'+id).get(0).volume*100, \t\t\tslide: function( event, ui ) { \t\t\t\t$( &quot;#vol_&quot;+id ).html( ui.value+&quot;%&quot; ); \t\t\t\t$('#audio_'+id).get(0).volume=(ui.value\/100); \t\t\t} \t\t});                 vol=Math.round($('#audio_'+id).get(0).volume*100);                 $( &quot;#vol_&quot;+id ).html( vol+&quot;%&quot; ); <\/code><\/pre>\n<p>  \u0423\u0437\u043d\u0430\u0451\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u0442\u0440\u0435\u043a\u0430 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043e \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0443  <\/p>\n<pre><code class=\"javascript\">var width=eval($('#audio_'+id).get(0).currentTime\/$('#audio_'+id).get(0).duration*100); \t\t$(&quot;#slider_&quot;+id).find(&quot;.ui-slider-range&quot;).css(&quot;width&quot;,width+&quot;%&quot;); \t\t$(&quot;#slider_&quot;+id).find(&quot;.ui-slider-handle&quot;).css(&quot;left&quot;,width+&quot;%&quot;); <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0443 \u043d\u0430\u0441 \u0442\u0440\u0435\u043a \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0442\u043e \u043c\u044b \u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u043f\u0430\u0443\u0437\u0443, \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u043a\u043e\u043d\u043a\u0443, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b (\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043b\u0438\u0448\u043d\u0438\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438) \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0440\u0435\u043a  <\/p>\n<pre><code class=\"javascript\">if(width==100){ \t\t\t$(&quot;#play_&quot;+id).removeClass(&quot;icon-pause&quot;).addClass(&quot;icon-play&quot;); \t\t\tp=0; \t\t\tplay(id+1); \t\t\tclearInterval( interval ); \t\t\twidth=0; \t\t} <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>function stop(idd)<\/code> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0442\u0440\u0435\u043a \u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e  <\/p>\n<pre><code class=\"javascript\">function stop(idd){ \t$('#currentTime_'+idd).html(&quot;0\/&quot;); \t$('#audio_'+idd).get(0).currentTime=0; \t$(&quot;#play_&quot;+idd).removeClass(&quot;icon-pause&quot;).removeClass(&quot;icon-play&quot;).addClass(&quot;icon-play&quot;); \tp=0; } <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u043b\u0435\u0435\u0440 \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445 Chrome, Mozilla Firefox, IE 9, Opera<\/p>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435, \u0438\u043b\u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0439 \u043a\u043e\u0434, \u0442\u043e \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/178847\/\"> http:\/\/habrahabr.ru\/post\/178847\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0425\u0430\u0431\u0440\u0430\u0432\u0447\u0430\u043d\u0435.<\/p>\n<p>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0437\u043d\u0430\u043d\u0438\u044f \u0432 JavaScript \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e\u043f\u043b\u0435\u0435\u0440. \u041a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u043c, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u043c \u0441 \u0432\u0430\u043c\u0438. \u0421\u043a\u0430\u0436\u0443 \u0441\u0440\u0430\u0437\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0432\u0430\u0442\u043e \u0441 \u043c\u043e\u0438\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 js \u0438 jQuery. \u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c \u043f\u043b\u0435\u0435\u0440.<\/p>\n<p>  1. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 music  <\/p>\n<pre><code class=\"php\">&lt;?php  $files = glob('music\/*'); ?&gt; <\/code><\/pre>\n<p>  2. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 jQuery \u0438 jQuery UI (\u0434\u043b\u044f \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430), \u0430 \u0442\u0430\u043a \u0436\u0435 \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b bootstrap \u0438\u043a\u043e\u043d\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043c\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043a\u043e\u043d\u043a\u0438 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-178847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178847"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178847\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}