fix video player

This commit is contained in:
Sean Yesmunt 2019-03-31 22:00:31 -04:00
parent e94892f584
commit d7d628ad1b
4 changed files with 17 additions and 17 deletions

View file

@ -25,7 +25,7 @@
"compile": "cross-env NODE_ENV=production yarn compile:electron && cross-env NODE_ENV=production yarn compile:web",
"dev": "yarn dev:electron",
"dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js",
"dev:web": "webpack-dev-server --open --hot --progress --config webpack.web.config.js",
"dev:web": "NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js",
"dev:internal-apis": "LBRY_API_URL='http://localhost:9090' yarn dev:electron",
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
"pack": "electron-builder --dir",

View file

@ -2,11 +2,9 @@
import type { Claim } from 'types/claim';
import React from 'react';
import { stopContextMenu } from 'util/context-menu';
import(
/* webpackChunkName: "videojs" */
/* webpackPreload: true */
'video.js/dist/video-js.css'
);
import(/* webpackChunkName: "videojs" */
/* webpackPreload: true */
'video.js/dist/video-js.css');
type Props = {
source: {
@ -23,8 +21,7 @@ class AudioVideoViewer extends React.PureComponent<Props> {
player: ?{ dispose: () => void };
componentDidMount() {
const me = this;
const { contentType, poster, claim } = me.props;
const { contentType, poster, claim } = this.props;
const path = `https://api.lbry.tv/content/claims/${claim.name}/${claim.claim_id}/stream.mp4`;
const sources = [
@ -42,13 +39,11 @@ class AudioVideoViewer extends React.PureComponent<Props> {
sources,
};
import(
/* webpackChunkName: "videojs" */
/* webpackMode: "lazy" */
/* webpackPreload: true */
'video.js'
).then((videojs) => {
me.player = videojs(me.videoNode, videoJsOptions, () => {});
import(/* webpackChunkName: "videojs" */
/* webpackMode: "lazy" */
/* webpackPreload: true */
'video.js').then(videojs => {
this.player = videojs.default(this.videoNode, videoJsOptions, () => {});
});
}

View file

@ -14,7 +14,7 @@ const UI_ROOT = path.resolve(__dirname, 'src/ui/');
const STATIC_ROOT = path.resolve(__dirname, 'static/');
const DIST_ROOT = path.resolve(__dirname, 'dist/');
console.log(ifProduction('production', 'development'))
console.log(ifProduction('production', 'development'));
let baseConfig = {
mode: ifProduction('production', 'development'),
@ -84,7 +84,7 @@ let baseConfig = {
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.EnvironmentPlugin(['NODE_ENV']),
new BundleAnalyzerPlugin(),
// new BundleAnalyzerPlugin(),
new ProvidePlugin({
i18n: ['i18n', 'default'],
__: ['i18n/__', 'default'],

View file

@ -4945,6 +4945,11 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
gud@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==
gzip-size@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.0.0.tgz#a55ecd99222f4c48fd8c01c625ce3b349d0a0e80"