8 八八八我要发发发 2天前 144次点击
怎么调动api接口啊我调动不了啊,应该说我调动不了社区的api接口
我让豆包弄然后豆包给我这样的html
const audioUrls = [
"https://bbs.tatans.cn/common/show_img?name=audio/8551/2108eddb-2643-4a69-b810-ed2ddb782e93.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/44d84fe9-b027-41ee-ade2-6419b20ad91e.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/d9937c79-d199-4170-9e94-d8d708b735ac.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/262962f6-eadd-4ff1-86af-f798b73b9cc4.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/d4b9ef26-266a-44dc-a4e1-ec607c95f775.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/e770b0a9-9ae8-44fc-be27-72535ebc4384.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/5534a145-2b80-4710-95f5-57b7087aeac4.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/5d6ce8d7-45a5-44a7-866a-c59f17409977.mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/ab269f10-6da9-4eb0-b567-60f1afad5c5a.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/2e65fea7-7d01-4946-96db-69fd0348cf98.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/9a89432b-16b8-4e9a-a2d3-f2e79b145dd4.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/1e0bc6ce-6a67-4d1a-ae9e-38b29f3a8588.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/8e36c1a3-3fa1-4d90-872c-c16f21ca1c8f.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/b079b8d8-4a19-4677-92a7-98b30cf30672.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/f425f68f-fa16-4196-8aa7-659c7d9703ee.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/fdf051ee-b0bd-485f-88ce-74d6503fafcc.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/2905bccc-d070-48e9-8000-bd0d4d487c63.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/84febbd2-9e3e-41a7-8bee-67174d302f4b.Mp3",
"https://bbs.tatans.cn/common/show_img?name=audio/8551/c0c02014-d647-4f9c-88c2-e0adbf39442a.Mp3"
];
function playRandomAudio() {
const randomIndex = Math.floor(Math.random() * audioUrls.length);
const audio = new Audio(audioUrls[randomIndex]);
audio.controls = true;
document.getElementById("audioContainer").innerHTML = "";
document.getElementById("audioContainer").appendChild(audio);
audio.play().catch(err => alert("播放失败:" + err.message));
}
可以播放但不随机
是的,咱也不知道他怎么搞的
再试一下
咱也不知道他怎么随机啊
我好像有点明白了但是我先去试一下
你明白了,我还没明白呢
我也不是特别了解所以我选择一边实验一边去研究
6
好家伙
已经发现好像就是这个样子
我也来试试
好吧,失败了,再去研究研究
这一次还是那个什么api吗