Compare commits

...

2 Commits

Author SHA1 Message Date
Cédric Verstraeten
6aed20c466 Align to correct region 2023-06-22 15:53:46 +02:00
Cedric Verstraeten
6672535544 fix glitch with loading livestream when hitting dashboard page first 2023-06-14 17:14:40 +02:00
2 changed files with 29 additions and 23 deletions

View File

@@ -95,7 +95,7 @@
"s3": {
"proxyuri": "http://proxy.kerberos.io",
"bucket": "kerberosaccept",
"region": "eu-west1"
"region": "eu-west-1"
},
"kstorage": {},
"dropbox": {},
@@ -112,4 +112,4 @@
"hub_private_key": "",
"hub_site": "",
"condition_uri": ""
}
}

View File

@@ -37,6 +37,7 @@ class Dashboard extends React.Component {
currentRecording: '',
initialised: false,
};
this.initialiseLiveview = this.initialiseLiveview.bind(this);
}
componentDidMount() {
@@ -48,30 +49,11 @@ class Dashboard extends React.Component {
});
});
}
this.initialiseLiveview();
}
componentDidUpdate() {
const { initialised } = this.state;
if (!initialised) {
const { connected, dispatchSend } = this.props;
const message = {
message_type: 'stream-sd',
};
if (connected) {
dispatchSend(message);
}
const requestStreamInterval = interval(2000);
this.requestStreamSubscription = requestStreamInterval.subscribe(() => {
if (connected) {
dispatchSend(message);
}
});
this.setState({
initialised: true,
});
}
this.initialiseLiveview();
}
componentWillUnmount() {
@@ -101,6 +83,30 @@ class Dashboard extends React.Component {
return Math.round(Date.now() / 1000);
}
initialiseLiveview() {
const { initialised } = this.state;
if (!initialised) {
const message = {
message_type: 'stream-sd',
};
const { connected, dispatchSend } = this.props;
if (connected) {
dispatchSend(message);
}
const requestStreamInterval = interval(2000);
this.requestStreamSubscription = requestStreamInterval.subscribe(() => {
const { connected: isConnected } = this.props;
if (isConnected) {
dispatchSend(message);
}
});
this.setState({
initialised: true,
});
}
}
openModal(file) {
this.setState({
open: true,