Skip to content

Commit 9ba14fc

Browse files
Merge pull request #280 from Azure-Samples/vriosrada/4240940/add-ovc-reason
#4240940: Adding ovc change reason
2 parents 767687e + fa2e6c8 commit 9ba14fc

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Project/src/MakeCall/CallCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export default class CallCard extends React.Component {
493493
const ovcFeature = this.call.feature(Features.OptimalVideoCount);
494494
const ovcChangedHandler = () => {
495495
if (this.state.ovc !== ovcFeature.optimalVideoCount) {
496-
this.setState({ ovc: ovcFeature.optimalVideoCount });
496+
this.setState({ ovc: ovcFeature.optimalVideoCount, lastOvcChangeReason: ovcFeature.lastOvcChangeReason });
497497
this.updateListOfParticipantsToRender('optimalVideoCountChanged');
498498
}
499499
}

Project/src/MakeCall/CurrentCallInformation.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { AzureLogger } from '@azure/logger';
55
const CurrentCallInformation = ({ sentResolution, call }) => {
66
const [ovcFeature, setOvcFeature] = useState();
77
const [optimalVideoCount, setOptimalVideoCount] = useState(1);
8+
const [lastOvcChangeReason, setLastOvcChangeReason] = useState('Unknown');
89

910
useEffect(() => {
1011
try {
@@ -24,6 +25,9 @@ const CurrentCallInformation = ({ sentResolution, call }) => {
2425

2526
const optimalVideoCountChanged = () => {
2627
setOptimalVideoCount(ovcFeature.optimalVideoCount);
28+
if (ovcFeature.lastOvcChangeReason) {
29+
setLastOvcChangeReason(ovcFeature.lastOvcChangeReason);
30+
}
2731
};
2832

2933
return (
@@ -34,7 +38,12 @@ const CurrentCallInformation = ({ sentResolution, call }) => {
3438
sentResolution && <div>Sent Resolution: {sentResolution}</div>
3539
}
3640
{
37-
ovcFeature && <div>Optimal Video Count: {optimalVideoCount}</div>
41+
ovcFeature && (
42+
<>
43+
<div>Optimal Video Count: {optimalVideoCount}</div>
44+
<div>Last OVC Change Reason: {lastOvcChangeReason}</div>
45+
</>
46+
)
3847
}
3948
</div>
4049
);

0 commit comments

Comments
 (0)