【问题标题】:how can I exactly create 360 video with react 360?如何使用 React 360 准确创建 360 视频?
【发布时间】:2020-10-14 20:20:27
【问题描述】:

今天,我开始了一个项目,需要在前端使用 3D 对象、360 图像和 360 视频。 所以我决定使用 react 360 库,因为我对 react 和 javascript 相当了解。 幸运的是,我设法轻松地制作了 360 度图像,但我发现制作 360 度视频真的很困难。 我尝试了很多方法,但都没有奏效。 文档几乎没有解释如何创建 360 度视频,而且我没有任何 3D 相关经验,所以我很难弄清楚如何实现这一点。

您能告诉我如何使用一些示例代码或示例创建 360 度全景视频吗?或者给我一些代码示例也将不胜感激。

我没有在这里发布我的代码,因为我在这里写的东西真的很乱而且没用。 提前谢谢你!!

【问题讨论】:

    标签: react-360


    【解决方案1】:

    index.js

    import React from 'react';
    import {
     Environment,
     asset,
     View
     } from 'react-360';
    
    import VideoModule from 'VideoModule';
    
    class Main extends React.Component {
    
        introVideo = VideoModule.createPlayer('introVideo')
    
        componentDidMount() {
            this.introVideo = VideoModule.createPlayer('introVideo')
            this.introVideo.play({
                source: { url: asset(`./video/name.mp4`).uri }
            })
    
            Environment.setBackgroundVideo('introVideo');
        }
    
        render() {
            return (
                <View/>
            )
        }
    }
    
    AppRegistry.registerComponent('Main', () => Main);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-07
      • 1970-01-01
      • 2020-12-17
      • 1970-01-01
      • 1970-01-01
      • 2016-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多