当前位置:网站首页>Solve the problem of using uni app mediaerror mediaerror errorcode -5
Solve the problem of using uni app mediaerror mediaerror errorcode -5
2022-07-07 21:06:00 【No Bug】
Need to give app Make a voice broadcast , First find an online Hecheng MP3 File website , The voice needed for synthesis is downloaded well .
Put it in the local file , To use it directly innerAudioContext.onPlay Just go .
I didn't expect it to be
After searching online for a long time, I couldn't find a solution ,/(ㄒoㄒ)/~~.
Then I tried the example of the official website , It can be played normally . I will change the broadcast address of the official example to my local address , Then it's the same !
It should not be able to play audio files with local addresses , Then I put my mp3 Save the file to Tencent cloud , It can be used normally .
Change to network address
openVoice() {
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src =
'http://1.14.142.212/zjl.mp3'
innerAudioContext.onPlay(() => {
console.log(' Start playing ');
});
innerAudioContext.onError((res) => {
console.log(res.errMsg);
console.log(res.errCode);
});
}
Played successfully . crying /(ㄒoㄒ)/~~
Here is a little talk about how to put local files on the network address .
Ideas :
1. You need a cloud server ( Buy ).
2. establish FTP Site
3. Create a website, map the file to the network address
The detailed steps
1. I use Tencent cloud , Enter the pagoda panel to create a FTP Site
2. Enter when you create FTP Root directory
Upload your file
3. Create a web site , Use it without a domain name IP, My domain name is still on record , So I used IP. Pay attention to the root directory and you FTP The consistency of .
Use
For example, I uploaded a mp3 file , The access address is
边栏推荐
- 【函数递归】简单递归的5个经典例子,你都会吗?
- [uvalive 6663 count the regions] (DFS + discretization) [easy to understand]
- 程序猿赚的那点钱算个P啊!
- 恶魔奶爸 A3阶段 近常速语流初接触
- ISO 26262 - 基于需求测试以外的考虑因素
- 如何满足医疗设备对安全性和保密性的双重需求?
- MySQL storage expression error
- Tensorflow2. How to run under x 1 Code of X
- Nebula importer data import practice
- 刚开户的能买什么股票呢?炒股账户安全吗
猜你喜欢
Codesonar Webinar
Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)
Implement secondary index with Gaussian redis
软件缺陷静态分析 CodeSonar 5.2 新版发布
Tensorflow2. How to run under x 1 Code of X
恶魔奶爸 B3 少量泛读,完成两万词汇量+
神兵利器——敏感文件发现工具
目标:不排斥 yaml 语法。争取快速上手
CodeSonar网络研讨会
上海交大最新《标签高效深度分割》研究进展综述,全面阐述无监督、粗监督、不完全监督和噪声监督的深度分割方法
随机推荐
Guava multithreading, futurecallback thread calls are uneven
FTP steps for downloading files from Huawei CE switches
MinGW MinGW-w64 TDM-GCC等工具链之间的差别与联系「建议收藏」
201215-03-19—cocos2dx内存管理–具体解释「建议收藏」
Apifox interface integrated management new artifact
awk处理JSON处理
Hdu4876zcc love cards (multi check questions)
浅解ARC中的 __bridge、__bridge_retained和__bridge_transfer
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
单词反转实现「建议收藏」
【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
How to choose financial products? Novice doesn't know anything
Intelligent software analysis platform embold
AADL inspector fault tree safety analysis module
Onespin | solve the problems of hardware Trojan horse and security trust in IC Design
【C语言】指针进阶---指针你真的学懂了吗?
私募基金在中国合法吗?安全吗?
写一下跳表
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
Le capital - investissement est - il légal en Chine? C'est sûr?