naviapps / create-nw-react-app

Create NW.js React apps with no build configuration.
MIT License
144 stars 14 forks source link

Adding videos to the project #6

Closed mparker11 closed 6 years ago

mparker11 commented 6 years ago

Has anyone ever tried adding a local video file to this project? I get a blank div even though the url is present in the dev tools, and that url is playable when pasting in a browser manually. I haven't changed any webpack files and I'm simply calling the video in my main App.js file like so:

import React, { Component } from 'react';
import { curious } from '@curi/react';
import AttractLoop from '../../assets/videos/video.mp4';

class App extends Component {
    render() {
        return (
            <div className="app-container">
                <div className="attract-loop">
                    <video width="1080" height="1920">
                        <source src={ AttractLoop } type="video/mp4" />
                    </video>
                </div>
            </div>
        );
    }
}

export default curious(App);
naviapis commented 6 years ago

NW.js does not support mp4 by default. https://github.com/nwjs/nw.js/wiki/Using-MP3-%26-MP4-%28H.264%29-using-the--video--%26--audio--tags. http://docs.nwjs.io/en/latest/For%20Developers/Enable%20Proprietary%20Codecs/ Please wait for a while because I am looking for a countermeasure.

mparker11 commented 6 years ago

Thanks for this! I would not have figured this out for a good while (as it had already been a few days before I raised the issue).