How to open video url in external player in react-native

只谈情不闲聊 提交于 2019-12-10 23:09:49

问题


I need to open links like this

http://somedomen.com/someplaylist.m3u8

in external videoplayer. I can't find the specific url scheme for this to Linking (so

Linking.openURL('video:http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4');

not works

Linking.openURL('intent://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4#Intent;action=android.intent.action.VIEW;scheme=http;type=video/mp4;end');

not works too )

I trying the module https://www.npmjs.com/package/react-native-intent with some modifications of mine.

It works, but when the external player opens and I press the BACK button - application closes without errors. I think that the new intent creates in the same activity.

So my question: Is there any way to open video links with external player (like share works but user need to select from video players installed on the system to open shared link with the selected one).


回答1:


Finally got it to work with this module http://npmjs.com/package/react-native-intent-launcher



来源:https://stackoverflow.com/questions/40820150/how-to-open-video-url-in-external-player-in-react-native

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