expo-video-player出现问题,它引发错误:setAudioModeAsync [英] Problem with expo-video-player, it throws Error: setAudioModeAsync

查看:62
本文介绍了expo-video-player出现问题,它引发错误:setAudioModeAsync的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

"expo-video-player"软件包有问题.我想通过expo-video-player播放视频,但是在加载组件时会引发错误,并且我不知道如何解决,所以我需要帮助.

I have a problem with 'expo-video-player' package. I want to show a video through expo-video-player but when I load the component it throws an error and I don't know how to resolve it, so I need help..

我尝试过更改软件包的源代码和组件props,但是它不起作用

I've tried change the package source code and the component props but it doesn't works

以下是代码:(来自expo-video-player的示例代码)

Here is the code: (Example code from expo-video-player)

import { Video } from 'expo'
import VideoPlayer from 'expo-video-player'

<VideoPlayer
 videoProps={{
 shouldPlay: true,
 resizeMode: Video.RESIZE_MODE_CONTAIN,
 source: {
   uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
  },
 }}
 isPortrait={true}
 playFromPositionMillis={0}
/>

这是错误:

错误:,setAudioModeAsync错误,1,[错误:试图在没有所需键的情况下设置音频模式:["staysActiveInBackground"]] -错误的node_modules \ react-native \ Libraries \ YellowBox \ YellowBox.js:59:8 -错误的node_modules \ expo \ build \ environment \ muteWarnings.fx.js:27:24 -...来自框架内部的另外17个堆栈框架

Error: , setAudioModeAsync error, 1, [Error: Audio mode attempted to be set without the required keys: ["staysActiveInBackground"]] - node_modules\react-native\Libraries\YellowBox\YellowBox.js:59:8 in error - node_modules\expo\build\environment\muteWarnings.fx.js:27:24 in error - ... 17 more stack frames from framework internals

有人可以帮助我吗?谢谢

Can anyone help me? Thanks

推荐答案

此问题是由Expo SDK 33创建的,其中一些模块已从核心中删除.

This issue was created by Expo SDK 33, where some modules has been removed from the core.

升级到最新版本(1.3.0).它在这里固定.

Upgrade to the latest version (1.3.0). It is fixed here.

https://www.npmjs.com/package/expo-video-player

这篇关于expo-video-player出现问题,它引发错误:setAudioModeAsync的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆