提交 32677328 编写于 作者: 雪洛's avatar 雪洛

feat: 部分测试、示例兼容微信小程序

上级 faa58d84
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('API-compressImage', () => {
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) {
if (
process.env.uniTestPlatformInfo.startsWith('web') ||
process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios') ||
process.env.uniTestPlatformInfo.startsWith('mp')
) {
it('pass', async () => {
expect(1).toBe(1);
});
......
// uni-app自动化测试教程: https://uniapp.dcloud.net.cn/worktile/auto/hbuilderx-extension/
describe('API-compressVideo', () => {
if (process.env.uniTestPlatformInfo.startsWith('web') || process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios')) {
if (
process.env.uniTestPlatformInfo.startsWith('web') ||
process.env.uniTestPlatformInfo.toLowerCase().startsWith('ios') ||
process.env.uniTestPlatformInfo.startsWith('mp')
) {
it('pass', async () => {
expect(1).toBe(1);
});
......
......@@ -118,6 +118,14 @@
this.currentTime = this._audioContext!.currentTime;
this.buffered = this._audioContext!.buffered;
console.log('onTimeUpdateCb', this.currentTime)
// #ifdef MP
// 微信小程序安卓端过早的时机获取的buffered、duration为0,改为在此处获取
if(this._audioContext!.duration === 0) {
this.buffered = this._audioContext!.buffered;
this.duration = this._audioContext!.duration
}
// #endif
if (this.currentTime > this.buffered) {
console.log('缓冲不足');
}
......@@ -146,6 +154,10 @@
this._audioContext!.onCanplay(() => {
console.log('音频进入可以播放状态事件');
this.isCanplay = true;
// #ifdef MP
// 微信小程序安卓端过早的时机获取的volume为undefine,改为在此处获取
this.volume = this._audioContext!.volume;
// #endif
// 当音频可以播放时,获取缓冲信息
this.buffered = this._audioContext!.buffered;
this.duration = this._audioContext!.duration
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册