add environment variable to set custom movie backend url
edit readme handle enter event on AuthenticationPage
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import {Button} from '../../elements/GPElements/Button';
 | 
			
		||||
import style from './AuthenticationPage.module.css';
 | 
			
		||||
import {addKeyHandler, removeKeyHandler} from '../../utils/ShortkeyHandler';
 | 
			
		||||
 | 
			
		||||
interface state {
 | 
			
		||||
    pwdText: string;
 | 
			
		||||
@@ -17,6 +18,16 @@ class AuthenticationPage extends React.Component<Props, state> {
 | 
			
		||||
        this.state = {
 | 
			
		||||
            pwdText: ''
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        this.keypress = this.keypress.bind(this);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    componentDidMount(): void {
 | 
			
		||||
        addKeyHandler(this.keypress);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    componentWillUnmount(): void {
 | 
			
		||||
        removeKeyHandler(this.keypress);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    render(): JSX.Element {
 | 
			
		||||
@@ -46,6 +57,20 @@ class AuthenticationPage extends React.Component<Props, state> {
 | 
			
		||||
            </>
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * key event handling
 | 
			
		||||
     * @param event keyevent
 | 
			
		||||
     */
 | 
			
		||||
    keypress(event: KeyboardEvent): void {
 | 
			
		||||
        // hide if escape is pressed
 | 
			
		||||
        if (event.key === 'Enter') {
 | 
			
		||||
            // call a parentsubmit if defined
 | 
			
		||||
            if (this.props.submit) {
 | 
			
		||||
                this.props.submit(this.state.pwdText);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default AuthenticationPage;
 | 
			
		||||
 
 | 
			
		||||
@@ -280,12 +280,18 @@ export class Player extends React.Component<myprops, mystate> {
 | 
			
		||||
            {action: 'loadVideo', MovieId: parseInt(this.props.match.params.id, 10)},
 | 
			
		||||
            (result: VideoTypes.loadVideoType) => {
 | 
			
		||||
                console.log(result);
 | 
			
		||||
                console.log(process.env.REACT_APP_CUST_BACK_DOMAIN);
 | 
			
		||||
                this.setState({
 | 
			
		||||
                    sources: {
 | 
			
		||||
                        type: 'video',
 | 
			
		||||
                        sources: [
 | 
			
		||||
                            {
 | 
			
		||||
                                src: getBackendDomain() + GlobalInfos.getVideoPath() + result.MovieUrl,
 | 
			
		||||
                                src:
 | 
			
		||||
                                    (process.env.REACT_APP_CUST_BACK_DOMAIN
 | 
			
		||||
                                        ? process.env.REACT_APP_CUST_BACK_DOMAIN
 | 
			
		||||
                                        : getBackendDomain()) +
 | 
			
		||||
                                    GlobalInfos.getVideoPath() +
 | 
			
		||||
                                    result.MovieUrl,
 | 
			
		||||
                                type: 'video/mp4',
 | 
			
		||||
                                size: 1080
 | 
			
		||||
                            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user