Trying to fix Source ID display

It looks like I had componentUpdate() defined twice in the mediaplayer.js file, so it wasn't getting called
This commit is contained in:
Luke Berndt
2021-06-24 21:28:18 -04:00
parent f49aba698c
commit 5f4c4a6372
3 changed files with 61 additions and 97 deletions

View File

@@ -61,7 +61,6 @@ class CallPlayer extends React.Component {
autoPlay: true, autoPlay: true,
callId: false, callId: false,
playTime: 0, playTime: 0,
sourceIndex: 0,
callScroll: false, callScroll: false,
callSelect: false, callSelect: false,
urlOptions: false, urlOptions: false,
@@ -259,7 +258,7 @@ class CallPlayer extends React.Component {
const nextCall = this.props.callsById[nextCallId]; const nextCall = this.props.callsById[nextCallId];
var callUrl = nextCall.url; var callUrl = nextCall.url;
this.setState({ callUrl: callUrl, callId: nextCallId, sourceIndex: 0, isPlaying: true }, () => { audio.playSource(callUrl) }); //scrollToComponent(this.currentCallRef.current); this.setState({ callUrl: callUrl, callId: nextCallId, isPlaying: true }, () => { audio.playSource(callUrl) }); //scrollToComponent(this.currentCallRef.current);
if (this.currentCallRef.current) { if (this.currentCallRef.current) {
this.currentCallRef.current.scrollIntoView({ this.currentCallRef.current.scrollIntoView({
behavior: "smooth", behavior: "smooth",
@@ -278,7 +277,6 @@ class CallPlayer extends React.Component {
this.setState({ this.setState({
callUrl: callUrl, callUrl: callUrl,
callId: data.call._id, callId: data.call._id,
sourceIndex: 0,
isPlaying: true isPlaying: true
}, () => { audio.playSource(callUrl); }); //scrollToComponent(this.currentCallRef.current); }, () => { audio.playSource(callUrl); }); //scrollToComponent(this.currentCallRef.current);
this.props.callActions.fetchCallInfo(data.call._id); this.props.callActions.fetchCallInfo(data.call._id);
@@ -345,7 +343,6 @@ class CallPlayer extends React.Component {
filter.live = false; filter.live = false;
this.setState({ this.setState({
callId: _id, callId: _id,
sourceIndex: 0,
urlOptions: true, urlOptions: true,
autoPlay: false, autoPlay: false,
callScroll: true, callScroll: true,
@@ -493,7 +490,6 @@ class CallPlayer extends React.Component {
var callUrl = call.url; var callUrl = call.url;
this.setState({ this.setState({
callUrl: callUrl, callUrl: callUrl,
sourceIndex: 0,
isPlaying: true, isPlaying: true,
callSelect: false callSelect: false
}, () => { audio.playSource(callUrl); }); //scrollToComponent(this.currentCallRef.current); }, () => { audio.playSource(callUrl); }); //scrollToComponent(this.currentCallRef.current);

View File

@@ -74,9 +74,6 @@ componentDidUpdate(prevProps) {
} }
} }
componentDidUpdate() {
}
render() { render() {
var playEnabled = { "disabled": true } var playEnabled = { "disabled": true }
@@ -121,35 +118,6 @@ render(){
</Menu.Item> </Menu.Item>
</Menu.Menu> </Menu.Menu>
/* <Media>
{
mediaProps => <Menu.Menu>
<Menu.Item onClick={() => mediaProps.playPause()} {...playEnabled} >
<Player src={callUrl} vendor="audio" onEnded={this.props.onEnded} autoPlay={true} onTimeUpdate={this.updatePlayProgress}/>
{
mediaProps.isPlaying
? (<Icon name="pause"/>)
: (<Icon name="play"/>)
}
</Menu.Item><Menu.Item>
<Progress inverted percent={this.state.playProgress}/>
<Label color="black">
{this.state.playTime}
Sec
</Label>
<Label color="black" className="desktop-only">
{sourceId}
</Label>
</Menu.Item>
</Menu.Menu>
}
</Media>*/
) )
} }
} }

View File

@@ -22,7 +22,7 @@ import ListSystemsContainer from "./System/ListSystemsContainer"
import CallPlayerContainer from "./Call/CallPlayerContainer" import CallPlayerContainer from "./Call/CallPlayerContainer"
ReactGA.initialize(process.env.REACT_APP_GOOGLE_ANALYTICS); ReactGA.initialize(process.env.REACT_APP_GOOGLE_ANALYTICS);
console.log(process.env);
const store = configureStore(/* provide initial state if any */) const store = configureStore(/* provide initial state if any */)
ReactDOM.render( ReactDOM.render(