svg点击播放音乐
先微信后台添加音频 然后添加完把代码复制出来
<foreignObject x="0" y="50" width="100%" height="850"> <section style="opacity:0;transform: scale(50)translate(-924px,-7px);"> <section class="wx-edui-media-wrp custom_select_card_wrp"><section class="js_editor_audio audio_iframe res_iframe js_uneditable custom_select_card" src="/cgi-bin/readtemplate?t=tmpl/audio_tmpl&name=bgmusic6.mp3&play_length=04:03" isaac2="1" low_size="496.45" source_size="496.4" high_size="952.27" name="bgmusic6.mp3" play_length="243000" voice_encode_fileid="MzA4NjYxNjgwOV8xMDAwMDg1MjE=" data-topic_id="" data-topic_name="" data-pluginname="insertaudio" contenteditable="false" style="margin-top: 50px;"><!-- 图文类型的音频卡片 --> <section class="appmsg_card_context appmsg_card_active audio_card js_audio_card"><strong class="audio_card_title">bgmusic6.mp3</strong><span class="weui-flex"><span class="weui-flex__item"><span class="audio_card_opr"><span class="audio_card_progress_wrp"><span class="audio_card_progress"><span class="audio_card_progress_inner"></span></span></span></span><span class="audio_card_tips" aria-labelledby="时长"><em class="audio_card_length_current">00:00</em><em class="audio_card_length_total">04:03</em></span></span><span aria-labelledby="播放开关" class="audio_card_switch"><em class="weui-audio-btn" role="button"></em></span></span><span class="audio_album_null js_no_album">未加入话题</span><span class="audio_album_null js_album_name" style="display: none;"></span><span class="audio_action js_audio_action" style="display: none;"><span class="audio_action_item js_replace_album" style="display: none;"><em class="audio_action_icon_switch"></em>修改话题</span><span class="audio_action_item js_add_album"><em class="audio_action_icon_add"></em>添加话题</span></span></section> </section></section> </section> </foreignObject>
然后就是调整下位置一定要点中按钮那个位置(注意一定要在预览情况下调整不是编辑模式)
调整这个
<section style="opacity:0;transform: scale(50)translate(-924px,-7px);">