Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 音频设置超时音乐背景_Javascript_Php_Jquery_Html_Wordpress - Fatal编程技术网

Javascript 音频设置超时音乐背景

Javascript 音频设置超时音乐背景,javascript,php,jquery,html,wordpress,Javascript,Php,Jquery,Html,Wordpress,我需要在音乐开始和结束后使用autostart/autoplay睡眠8秒,现在在后台加载音乐,完成时无需等待8秒 以下代码不起作用: 。$new\u div\u end.”; 返回str\u replace(“\r\n”,“”,$content); } 您是否希望处理“结束”事件而不是“加载数据”?根据W3,加载的数据“在浏览器加载音频/视频的当前帧时触发”。结束事件“当前播放列表结束时触发”,这听起来更像是您想要的。抱歉,不清楚,请查看此处的“事件”部分-。我认为你在处理错误的事件,以便在播

我需要在音乐开始和结束后使用autostart/autoplay睡眠8秒,现在在后台加载音乐,完成时无需等待8秒

以下代码不起作用:



。$new\u div\u end.

”; 返回str\u replace(“\r\n”,“”,$content); }
您是否希望处理“结束”事件而不是“加载数据”?根据W3,加载的数据“在浏览器加载音频/视频的当前帧时触发”。结束事件“当前播放列表结束时触发”,这听起来更像是您想要的。抱歉,不清楚,请查看此处的“事件”部分-。我认为你在处理错误的事件,以便在播放结束时收听。如果你想让它在开始和停止之间留出8秒的间隔,那么我认为你需要听回放的结束,而不是数据加载的结束
  $rand_no=mt_rand (10000,1000000);
        $content='<p><script>
            jQuery(function() {
                jQuery("#lbg_audio1_html5_'.$row["id"].$rand_no.'").audio1_html5({
                    skin:"'.$row["skin"].'",
                    initialVolume:'.$row["initialVolume"].',
                    autoPlay:'.$row["autoPlay"].',
                    loop:'.$row["loop"].',
                    shuffle:'.$row["shuffle"].',
                    continuouslyPlayOnAllPages:'.$row["continuouslyPlayOnAllPages"].',
                    playerPadding:'.$row["playerPadding"].',
                    playerBg:"#'.$row["playerBg"].'",
                    bufferEmptyColor:"#'.$row["bufferEmptyColor"].'",
                    bufferFullColor:"#'.$row["bufferFullColor"].'",
                    seekbarColor:"#'.$row["seekbarColor"].'",
                    volumeOffColor:"#'.$row["volumeOffColor"].'",
                    volumeOnColor:"#'.$row["volumeOnColor"].'",
                    timerColor:"#'.$row["timerColor"].'",
                    songAuthorTitleColor:"#'.$row["songAuthorTitleColor"].'",
                    showRewindBut:'.$row["showRewindBut"].',
                    showPlayBut:'.$row["showPlayBut"].',
                    showPreviousBut:'.$row["showPreviousBut"].',
                    showNextBut:'.$row["showNextBut"].',
                    showPlaylistBut:'.$row["showPlaylistBut"].',
                    showVolumeBut:'.$row["showVolumeBut"].',                
                    showVolumeSliderBut:'.$row["showVolumeSliderBut"].',
                    showTimer:'.$row["showTimer"].',
                    showSeekBar:'.$row["showSeekBar"].',
                    showAuthor:'.$row["showAuthor"].',
                    showTitle:'.$row["showTitle"].',
                    showPlaylist:'.$row["showPlaylist"].',              
                    showPlaylistOnInit:'.$row["showPlaylistOnInit"].',              
                    playlistTopPos:'.$row["playlistTopPos"].',              
                    playlistBgColor:"#'.$row["playlistBgColor"].'",
                    playlistRecordBgOffColor:"#'.$row["playlistRecordBgOffColor"].'",
                    playlistRecordBgOnColor:"#'.$row["playlistRecordBgOnColor"].'",
                    playlistRecordBottomBorderOffColor:"#'.$row["playlistRecordBottomBorderOffColor"].'",
                    playlistRecordBottomBorderOnColor:"#'.$row["playlistRecordBottomBorderOnColor"].'",
                    playlistRecordTextOffColor:"#'.$row["playlistRecordTextOffColor"].'",
                    playlistRecordTextOnColor:"#'.$row["playlistRecordTextOnColor"].'",
                    numberOfThumbsPerScreen:'.$row["numberOfThumbsPerScreen"].',
                    playlistPadding:'.$row["playlistPadding"].',
                    showPlaylistNumber:'.$row["showPlaylistNumber"].',
                    isSliderInitialized:'.$row["isSliderInitialized"].',
                    isProgressInitialized:'.$row["isProgressInitialized"].'     
                });
            });
        </script>   
        '.$new_div_start.'<div class="audio1_html5">

                <audio id="lbg_audio1_html5_'.$row["id"].$rand_no.'" preload="'.$preload_aux.'">
                      <div class="xaudioplaylist">'.$playlist_str.'</div>
                      <audio controls="controls" onloadeddata="var audioPlayer = this; setTimeout(function() { audioPlayer.play(); }, 8000)">
                  No HTML5 audio playback capabilities for this browser. Use <a href="https://www.google.com/intl/en/chrome/browser/">Chrome Browser!</a>    
                </audio>     
         </div>             
        <br style="clear:both;">'.$new_div_end.'</p>';

        return str_replace("\r\n", '', $content);
    }