当前位置:网站首页>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
边栏推荐
- MySQL约束之默认约束default与零填充约束zerofill
- Jetty:配置连接器[通俗易懂]
- 【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
- 使用高斯Redis实现二级索引
- Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)
- 复杂因子计算优化案例:深度不平衡、买卖压力指标、波动率计算
- Don't fall behind! Simple and easy-to-use low code development to quickly build an intelligent management information system
- Helix QAC 2020.2新版静态测试工具,最大限度扩展了标准合规性的覆盖范围
- Klocwork code static analysis tool
- 201215-03-19—cocos2dx内存管理–具体解释「建议收藏」
猜你喜欢
上海交大最新《标签高效深度分割》研究进展综述,全面阐述无监督、粗监督、不完全监督和噪声监督的深度分割方法
Lex & yacc of Pisa proxy SQL parsing
【C语言】指针进阶---指针你真的学懂了吗?
Nebula Importer 数据导入实践
Tensorflow2.x下如何运行1.x的代码
C language helps you understand pointers from multiple perspectives (1. Character pointers 2. Array pointers and pointer arrays, array parameter passing and pointer parameter passing 3. Function point
ERROR: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your
神兵利器——敏感文件发现工具
程序猿赚的那点钱算个P啊!
ISO 26262 - 基于需求测试以外的考虑因素
随机推荐
uva 12230 – Crossing Rivers(概率)「建议收藏」
程序猿赚的那点钱算个P啊!
恶魔奶爸 B2 突破语法,完成正统口语练习
恶魔奶爸 C
95年专注安全这一件事 沃尔沃未来聚焦智能驾驶与电气化领域安全
Écrivez une liste de sauts
Lingyun going to sea | yidiantianxia & Huawei cloud: promoting the globalization of Chinese e-commerce enterprise brands
Implement secondary index with Gaussian redis
Helix QAC 2020.2 new static test tool maximizes the coverage of standard compliance
Guava multithreading, futurecallback thread calls are uneven
私募基金在中国合法吗?安全吗?
Data sorting in string
[UVALive 6663 Count the Regions] (dfs + 离散化)[通俗易懂]
Codeforces 474 F. Ant colony
Jetty:配置连接器[通俗易懂]
恶魔奶爸 A3阶段 近常速语流初接触
Write a jump table
CodeSonar网络研讨会
智能软件分析平台Embold
Alibaba cloud award winning experience: how to mount NAS file system through ECS