dqc2017 2017-04-20 12:02
浏览 33

音频设置超时音乐背景

I need to use a sleep for 8 seconds after the music start and finish with autostart/autoplay, right now the music loading in background when finish without wait 8 seconds.

Following code is not working:

<audio controls="controls" onloadeddata="var audioPlayer = this; setTimeout(function() { audioPlayer.play(); }, 8000)">

but the goals is sleep for 8 seconds before restart again the music in background.

  $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("
", '', $content);
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示