Problem with expo-video-player, it throws Error: setAudioModeAsync

泄露秘密 提交于 2019-12-11 00:41:23

问题


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..

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

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}
/>

Here is the error:

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


回答1:


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

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

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



来源:https://stackoverflow.com/questions/56827764/problem-with-expo-video-player-it-throws-error-setaudiomodeasync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!