当前位置:网站首页>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
边栏推荐
- 使用高斯Redis实现二级索引
- openGl超级宝典学习笔记 (1)第一个三角形「建议收藏」
- The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
- HOJ 2245 浮游三角胞(数学啊 )
- 软件缺陷静态分析 CodeSonar 5.2 新版发布
- Implement secondary index with Gaussian redis
- FTP steps for downloading files from Huawei CE switches
- 权限不足
- Flask1.1.4 werkzeug1.0.1 source code analysis: Routing
- Codesonar Webinar
猜你喜欢

OneSpin | 解决IC设计中的硬件木马和安全信任问题

Apifox interface integrated management new artifact
MySQL storage expression error

软件缺陷静态分析 CodeSonar 5.2 新版发布

神兵利器——敏感文件发现工具

The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
Lex & yacc of Pisa proxy SQL parsing

ISO 26262 - 基于需求测试以外的考虑因素

【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)

H3C s7000/s7500e/10500 series post stack BFD detection configuration method
随机推荐
Flask1.1.4 werkzeug1.0.1 source code analysis: Routing
国家正规的股票交易app有哪些?使用安不安全
2022年在启牛开中银股票的账户安全吗?
静态测试工具
写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
Spark judges that DF is empty
权限不足
C语言多角度帮助你深入理解指针(1. 字符指针2. 数组指针和 指针数组 、数组传参和指针传参3. 函数指针4. 函数指针数组5. 指向函数指针数组的指针6. 回调函数)
Do you have to make money in the account to open an account? Is the fund safe?
Helix QAC 2020.2新版静态测试工具,最大限度扩展了标准合规性的覆盖范围
Small guide for rapid formation of manipulator (12): inverse kinematics analysis
Intelligent software analysis platform embold
Implement secondary index with Gaussian redis
Is it safe to open a stock account at present? Can I open an account online directly.
[matrix multiplication] [noi 2012] [cogs963] random number generator
margin 等高布局
Cocos2d-x game archive [easy to understand]
Intelligent transportation is full of vitality. What will happen in the future? [easy to understand]
【矩阵乘】【NOI 2012】【cogs963】随机数生成器
恶魔奶爸 指南帖——简易版