在屏幕之间共享视频组件 [英] Share Video component between screens

查看:26
本文介绍了在屏幕之间共享视频组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有缩略图大小的 <Video> 正在播放的屏幕,然后转换到另一个屏幕,视频通过 react-navigation 占据整个窗口.

I have a screen with a thumbnail sized <Video> playing and then transition to another screen where the video takes up the full window via react-navigation.

有没有办法保留该视频元素并将其传输到新屏幕?如果我渲染一个新的 <Video>,它会增加一个延迟,因为视频在开始播放之前必须缓冲,而不是无缝过渡,我可以在调整大小时设置动画.

Is there a way to preserve that video element and transfer it to the new screen? If I render a new <Video>, it adds a delay as the video has to buffer before it can start playing rather than being a seamless transition where I can animate as the resize happens.

推荐答案

一旦 RFC 17 完成,这应该在未来版本的 react-navigation 中得到支持:https://github.com/react-navigation/rfcs/issues/17

This should be supported in a future version of react-navigation once RFC 17 is completed: https://github.com/react-navigation/rfcs/issues/17

与此同时,有一个名为 Fluid Transitions 的单独项目来支持它:https://github.com/fram-x/FluidTransitions

In the meantime, there is a separate project called Fluid Transitions to support it: https://github.com/fram-x/FluidTransitions

我还没有测试这是否适用于视频,但它确实允许图像等的共享过渡.

I have not gotten to test whether this will work for videos yet, but it does allow shared transitions for images, etc.

这篇关于在屏幕之间共享视频组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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