如何在React-Native中在外部播放器中打开视频URL [英] How to open video url in external player in react-native

查看:299
本文介绍了如何在React-Native中在外部播放器中打开视频URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要打开这样的链接

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');

不起作用

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 )

我尝试了模块 https://www.npmjs.com/package/react-native-intent ,并对我的内容进行了一些修改。

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

它可以工作,但是当外部播放器打开并且我按BACK按钮时,应用程序关闭而没有错误。我认为新的意图是在同一活动中创建的。

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

推荐答案

最后得到了它可以与此模块一起使用 http://npmjs.com/package/react-native-intent -launcher

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

这篇关于如何在React-Native中在外部播放器中打开视频URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆