如何在本机播放中打开视频?!像动漫,流媒体应用程序等...
它不起作用
Linking.openURL('video:http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4'); }
如何在本机播放中打开视频?!像动漫,流媒体应用程序等...
它不起作用
Linking.openURL('video:http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4'); }
它适用于 Android 试试这个
import React from 'react';
import {NativeModules, Button} from 'react-native';
const App = () => {
const SendIntentAndroid = NativeModules?.SendIntentAndroid || {};
const onPress = () => {
SendIntentAndroid?.openAppWithData(
null, // Package name
'https://www.w3schools.com/html/mov_bbb.mp4', // uri
'video/*', // mime/type
{}, // extras
);
};
return <Button onPress={onPress} title={'Open video playback'} />;
};
export default App;
如果不起作用,请尝试安装
yarn add react-native-send-intent
npm install react-native-send-intent
环境: