@douglowder/expo-av-route-picker-view

中文文档
0.0.5发布于 2024/07/06MITTypeScriptCommonJS零依赖近 30 天下载 1.5万

React Native wrapper for the iOS AVRoutePickerView (selector for AirPlay devices)

原始使用文档

expo-av-route-picker-view

iOS/tvOS only React Native wrapper for the AVRoutePickerView (selector for AirPlay devices)

Example

(See also the working example in this repo.

import { Pressable, StyleSheet, Text, View } from 'react-native';

import { ExpoAvRoutePickerView } from 'expo-av-route-picker-view';

export default function App() {
  return (
    <View style={styles.container}>
      <Pressable onPress={() => {}}>
        {({ pressed, focused }) => {
          return (
            <View style={{ opacity: focused || pressed ? 0.6 : 1.0 }}>
              <Text>Here is the route picker!</Text>
            </View>
          );
        }}
      </Pressable>
      <ExpoAvRoutePickerView
        style={styles.picker}
        tintColor="#000000"
        activeTintColor="#0000FF"
        prioritizesVideoDevices
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
  picker: {
    width: 100,
    height: 100,
  },
});

Installation in managed Expo projects

For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.

Installation in bare React Native projects

For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.

Add the package to your npm dependencies

npm install expo-av-route-picker-view

Configure for iOS

Run npx pod-install after installing the npm package.

Contributing

Contributions are very welcome! Please refer to guidelines described in the contributing guide.

版本与发布记录

@douglowder/expo-av-route-picker-view 共发布 5 个版本,首次发布于 2024/06/01;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.5latest2024/07/062 年前
0.0.42024/06/172 年前
0.0.32024/06/042 年前
0.0.22024/06/012 年前
0.0.12024/06/012 年前

关于 @douglowder/expo-av-route-picker-view 的常见问题

@douglowder/expo-av-route-picker-view 是什么?

React Native wrapper for the iOS AVRoutePickerView (selector for AirPlay devices)

如何安装 @douglowder/expo-av-route-picker-view?

在项目目录运行 npm install @douglowder/expo-av-route-picker-view,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:expo(*)、react(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@douglowder/expo-av-route-picker-view 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@douglowder/expo-av-route-picker-view 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@douglowder/expo-av-route-picker-view 可以商用吗?

@douglowder/expo-av-route-picker-view 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@douglowder/expo-av-route-picker-view 的下载量有多少?

根据 npm 官方下载统计,@douglowder/expo-av-route-picker-view 在 2026/10/13 – 2026/11/11 这 30 天内被下载 15,460 次,日均约 515 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@douglowder/expo-av-route-picker-view 还在维护吗?

最新版本 0.0.5 发布于 2024/07/06(2 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/06/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。