我做了一个 index.html 具有此脚本的文件。
<html>
<body>
<object type="application/x-shockwave-flash" data="player-mini.swf?mp3=file:\\\D:\music\aa.mp3" width="160" height="20" id="dewplayer-mini"><param name="wmode" value="transparent" /><param name="movie" value="player-mini.swf?mp3=file:\\\D:\music\aa.mp3" /></object>
</body>
</html>
我用了露水播放器 作为我网站的音频播放器,问题是,当我使用 localhost 打开这个 index.html 文件时,mp3 无法播放,而当我直接 [通过双击] 打开这个 index.html 文件时,mp3 播放正常。
我知道问题是 Mp3 文件路径,请告诉我如何提供 mp3 文件路径,以便它可以在 localhost 中正常工作。 [露水播放器没问题]。
最佳答案
您正在使用 file:\\\
协议(protocol)
更改您的删除 file:\\\
从您的路径到文件(将您的 aa.mp3
移动到您的 index.html
所在的位置
<html>
<body>
<object type="application/x-shockwave-flash" data="player-mini.swf?mp3={Path_TO_Mp3}/aa.mp3" width="160" height="20" id="dewplayer-mini"><param name="wmode" value="transparent" /><param name="movie" value="player-mini.swf?mp3={Path_TO_Mp3}/aa.mp3" /></object>
</body>
</html>
关于html - 如何解决 localhost/网站中 swf 音频播放器的 mp3 文件路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20731008/