iOS设备使用expo-av播放Vimeo视频报错-11850求助
iOS下Expo-AV无法播放Vimeo视频问题排查与解决
问题现象
- 使用
expo-av组件播放Expo官方示例视频(https://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4)正常,但播放指定Vimeo视频链接(https://player.vimeo.com/video/949579770?h=897cd5e78)失败,加不加.mp4后缀都无效。
错误日志
YYYYYYYY {"error": "The server is not correctly configured. - The AVPlayerItem instance has failed with the error code -11850 and domain "AVFoundationErrorDomain".", "isLoaded": false}
代码片段
import { Video, ResizeMode } from "expo-av"; <Video source={{ uri: "https://player.vimeo.com/video/949579770?h=897cd5e781.mp4" // 加不加.mp4都无法播放 }} className="w-52 h-72 rounded-[35px] mt-3 bg-white/30" resizeMode={ResizeMode.CONTAIN} useNativeControls shouldPlay onPlaybackStatusUpdate={(status) => console.log("YYYYYYYY", status)} onLoad={(status) => console.log("XXXXXXXXXXXXXXX", status)} />
环境信息
- 开发系统:Windows 11
- Node.js版本:v20.14.0
- 技术栈:TypeScript + React Native + Expo
- package.json配置:
{ "name": "aora", "main": "expo-router/entry", "version": "1.0.0", "scripts": { "start": "expo start", "reset-project": "node ./scripts/reset-project.js", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web", "test": "jest --watchAll", "lint": "expo lint" }, "jest": { "preset": "jest-expo" }, "dependencies": { "@expo/vector-icons": "^14.0.2", "@react-navigation/native": "^6.0.2", "expo": "~51.0.24", "expo-av": "^14.0.6", "expo-constants": "~16.0.2", "expo-font": "~12.0.9", "expo-linking": "~6.3.1", "expo-router": "~3.5.20", "expo-splash-screen": "~0.27.5", "expo-status-bar": "~1.12.1", "expo-system-ui": "~3.0.7", "expo-web-browser": "~13.0.3", "nativewind": "^2.0.11", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.74.3", "react-native-animatable": "^1.4.0", "react-native-appwrite": "^0.4.0", "react-native-gesture-handler": "~2.16.1", "react-native-reanimated": "~3.10.1", "react-native-safe-area-context": "4.10.5", "react-native-screens": "3.31.1", "react-native-url-polyfill": "^2.0.0", "react-native-web": "~0.19.10" }, "devDependencies": { "@babel/core": "^7.20.0", "@types/jest": "^29.5.12", "@types/react": "~18.2.45", "@types/react-test-renderer": "^18.0.7", "jest": "^29.2.1", "jest-expo": "~51.0.3", "react-test-renderer": "18.2.0", "tailwindcss": "^3.3.2", "typescript": "~5.3.3" }, "private": true }
效果截图

疑问
当前跟随JS Mastery的React Native教程,教程案例可正常运行,请问该问题是否与目标视频本身有关?求解决方法。
问题原因与解决方法
- 链接类型错误:你使用的是Vimeo播放器页面链接(
player.vimeo.com/video/xxx),而非视频源文件的直接URL。Expo-AV需要可直接流式传输的视频资源地址,而非网页嵌入链接,这是导致加载失败的核心原因。 - 获取正确视频源的方式:
- 公开Vimeo视频:需通过Vimeo API(如
GET /videos/{video_id}接口)获取files字段中的直接播放地址,前提是你拥有Vimeo开发者账号并完成API授权。 - 私有/权限视频:若目标视频设置了访问限制,播放请求需携带对应授权凭证(如token),否则服务器会拒绝AVPlayer的请求,触发错误码-11850(AVFoundation资源加载权限/配置错误)。
- 公开Vimeo视频:需通过Vimeo API(如
- 临时验证方案:
- 找一个公开Vimeo视频的直接源地址测试,确认Expo-AV组件功能正常。
- 检查目标视频的隐私设置,若为私有,需确保请求携带合法访问凭证。
内容的提问来源于stack exchange,提问作者Poor programmer
相关产品推荐
相关产品推荐

