Support » Plugin: WaveSurfer-WP » Problems creating a dynamic audio player

  • Resolved hurra03


    Hi – love this plugin!!

    When I use it in the traditional way with a fixed url for the source, it works beautifully. However, I’m having problems when I send a variable as the source.

    Here for instance, with pointy brackets, the default player appears, and plays theselected file correctly:

    <!DOCTYPE html>
    	<script type="text/javascript"></script>
    <div class="player">
           <h1>名字:<script type="text/javascript">
                     var babyname = sessionStorage.getItem("babyname")
    	<audio id='audio_core' src = '' controls ></audio>
    		var babyname = sessionStorage.getItem("babyname"), mypath=""+ babyname +".mp3", src=mypath,
    			audio_core=$('#audio_core').attr('src', src)[0]
    		audio_core.load() // <- play the song!!!
           <h2>意義:<script type="text/javascript">
                     var babyname = sessionStorage.getItem("babyname")
           <p> 这是根据你的选择而设计的名字 </p>
           <p> 请随意下载音频文件并与家人和朋友分享 </p>
           <p> 我们建议最多选出三个名字,这样你与家人和朋友分享时可以去粗取精。 </p>
            <p><a href="">请点击这里从我们的代理处请求另一个名字</a></p>'

    but when I replace the pointy brackets on the audio shortcode with square brackets:

    [audio id='audio_core' src = '' controls][/audio]

    your player appears, but there’s no source is passed (so the buttons appear, but there is no waveform).

    Thank you!!!!!

    • This topic was modified 2 years, 7 months ago by hurra03.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problems creating a dynamic audio player’ is closed to new replies.