javascript - Can you link to external mp3 file and play it on server
问题描述
I'm doing a project where I can't host the actual audio files in the site folder so I have to link to a gofile mp3. When I do this playback works great on localhost but as soon as I upload to server it will not play the mp3. Is there something I am doing wrong?
Here is an example of where put in the external link and when it is asked to play.
var sound1 = new Audio('https://srv-file16.gofile.io/download/LRQQr1/When%20the%20Summer%20Ends%20-%20Official%20Audio.mp3');
if(form.userid.value == "GREY")
{
$(".modalDialog").css({"opacity":"0","pointer-events":"none"});
setTimeout(location.reload.bind(location), 206000);
sound1.play()
rainbow.style.visibility='hidden'
forehead.style.visibility='hidden'
}
解决方案
推荐阅读
- php - 使 WC_Cart add_to_cart 方法适用于 Woocommerce 中的客人
- .net - 如何重定向错误但不输出并将文本以正确的顺序写入控制台?(F#)
- markdown - 如何根据 markdown frontmatter 过滤图形 ql 查询?
- javascript - Jquery focusout 不会触发
- git - Git重置原点/主
- c# - 循环的存储选项?C#
- sql - Oracle SQl Developer ORA-01017:用户名/密码无效;登录被拒绝
- c++ - 为什么编译器会测试地址中的最低有效位?
- ios - 我可以在没有服务器的情况下从 ios 向 ios 发送推送通知吗?
- sas - 在宏函数中分配 tranwrd 的宏变量输出