Skip to content

Commit 6a042a4

Browse files
authored
Merge pull request #248885 from ShawnJackson/media-quality-sdk
[AQ] edit pass: media-quality-sdk
2 parents 7326989 + ccaae3b commit 6a042a4

File tree

6 files changed

+344
-324
lines changed

6 files changed

+344
-324
lines changed
Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Azure Communication Services Media Stats (Android)
3-
titleSuffix: An Azure Communication Services concept document
4-
description: Provides usage samples of the Media Stats feature Android Native.
2+
title: Azure Communication Services media quality statistics (Android)
3+
titleSuffix: An Azure Communication Services concept article
4+
description: Get usage samples of the media quality statistics feature for Android native.
55
author: jsaurezle-msft
66
ms.author: jsaurezlee
77

@@ -12,81 +12,80 @@ ms.service: azure-communication-services
1212
ms.subservice: calling
1313
---
1414

15-
## Media quality statistics for ongoing call
15+
## Media quality statistics for an ongoing call
1616

17-
[!INCLUDE [public-preview-notes](../../../../includes/public-preview-include.md)]
18-
19-
Media quality statistics is an extended feature of the core `Call` API. You first need to obtain the MediaStats feature API object:
17+
Media quality statistics is an extended feature of the core `Call` API. You first need to obtain the `MediaStatsCallFeature` API object:
2018

2119
```java
2220
MediaStatsCallFeature mediaStatsCallFeature = call.feature(Features.MEDIA_STATS);
2321
```
2422

25-
The Media Stats feature object have the following API structure:
26-
- `OnSampleReportedListener`: Event for listening for periodic reports of the Media Stats.
27-
- `setSampleIntervalInSeconds(int value)`: Sets the interval in seconds of the Media Stats report generation. If not specified, sdk use defaults.
28-
- A `MediaStatsReport` object that contains the definition of the Outgoing and Incoming Media Stats categorized by Audio, Video and Screen Share.
29-
- `getOutgoingMediaStats()`: The list of Media Stats for Outgoing media.
30-
- `getAudio()`: The list of Media Stats for the Outgoing Audio.
31-
- `getVideo()`: The list of Media Stats for the Outgoing Video.
32-
- `getScreenShare()`: The list of Media Stats for the Outgoing Screen Share.
33-
- `getIncomingStats()`: The list of Media Stats for Incoming media.
34-
- `getAudio()`: The list of Media Stats for the Incoming Audio.
35-
- `getVideo()`: The list of Media Stats for the Incoming Video.
36-
- `getScreenShare()`: The list of Media Stats for the Incoming Screen Share.
23+
The `MediaStatsCallFeature` object has the following API structure:
24+
25+
- The `OnSampleReportedListener` event listens for periodic reports of the media statistics.
26+
- `setSampleIntervalInSeconds(int value)` sets the interval, in seconds, of the media statistics report generation. If it's not specified, the SDK uses defaults.
27+
- A `MediaStatsReport` object contains the definition of the outgoing and incoming media statistics, categorized by audio, video, and screen share.
28+
- `getOutgoingMediaStats()`: The list of media statistics for outgoing media.
29+
- `getAudio()`: The list of media statistics for outgoing audio.
30+
- `getVideo()`: The list of media statistics for outgoing video.
31+
- `getScreenShare()`: The list of media statistics for outgoing screen share.
32+
- `getIncomingStats()`: The list of media statistics for incoming media.
33+
- `getAudio()`: The list of media statistics for incoming audio.
34+
- `getVideo()`: The list of media statistics for the incoming video.
35+
- `getScreenShare()`: The list of media statistics for incoming screen share.
3736
- `getGeneratedAt()`: The date when the report was generated.
38-
- `getIncomingMediaStatsFromParticipant`: Gets the `IncomingMediaStats` for a `RemoteParticipant`.
37+
- `getIncomingMediaStatsFromParticipant`: Gets the `IncomingMediaStats` value for `RemoteParticipant`.
3938

4039
Then, subscribe to the `addOnSampleReportedListener` event to get regular updates about the current media quality statistics:
4140

4241
```java
4342
mediaStatsCallFeature.addOnSampleReportedListener(handleSampleReportedListener);
44-
// Optional, set the interval for Media Stats report generation
43+
// Optionally, set the interval for media statistics report generation
4544
mediaStatsCallFeature.setSampleReportedIntervalInSeconds(15);
4645

4746
private void handleSampleReportedListener(MediaStatsReportEvent args) {
48-
// Obtain the Media Stats Report instance.
47+
// Obtain the media statistics report instance
4948
MediaStatsReport report = args.getReport();
5049

51-
// Obtain the Outgoing Media Stats for Audio
50+
// Obtain the outgoing media statistics for audio
5251
List<OutgoingAudioMediaStats> outgoingAudioMediaStats = report.getOutgoingMediaStats().getAudio();
5352

54-
// Obtain the Outgoing Media Stats for Video
53+
// Obtain the outgoing media statistics for video
5554
List<OutgoingVideoMediaStats> outgoingVideoMediaStats = report.getOutgoingMediaStats().getVideo();
5655

57-
// Obtain the Outgoing Media Stats for Screen Share
56+
// Obtain the outgoing media statistics for screen share
5857
List<OutgoingScreenShareMediaStats> outgoingScreenShareMediaStats = report.getOutgoingMediaStats().getScreenShare();
5958

60-
// Obtain the Incoming Media Stats for Audio
59+
// Obtain the incoming media statistics for audio
6160
List<IncomingAudioMediaStats> incomingAudioMediaStats = report.getIncomingMediaStats().getAudio();
6261

63-
// Obtain the Incoming Media Stats for Video
62+
// Obtain the incoming media statistics for video
6463
List<IncomingVideoMediaStats> incomingVideoMediaStats = report.getIncomingMediaStats().getVideo();
6564

66-
// Obtain the Incoming Media Stats for Screen Share
65+
// Obtain the incoming media statistics for screen share
6766
List<IncomingScreenShareMediaStats> incomingScreenShareMediaStats = report.getIncomingMediaStats().getScreenShare();
6867
}
6968
```
7069

71-
Also, `MediaStatsReport` have a helper method to obtain the `IncomingMediaStats` for a particular `RemoteParticipant`.
72-
For example, in order to get the `IncomingMediaStats` for all the `RemoteParticipants` in the call you can:
70+
Also, `MediaStatsReport` has a helper method to obtain the `IncomingMediaStats` value for a particular `RemoteParticipant` instance.
71+
For example, to get the `IncomingMediaStats` value for all the remote participants in the call, you can use:
7372

7473
```java
7574
private void handleSampleReportedListener(MediaStatsReportEvent args) {
7675
List<RemoteParticipant> remoteParticipants = call.getRemoteParticipants();
7776
for (RemoteParticipant remoteParticipant : remoteParticipants) {
7877
{
7978
IncomingMediaStatsInfo incomingMediaStatsInfo = report.getIncomingMediaStatsFromParticipant(remoteParticipant.getIdentifier());
80-
// Obtain the Incoming Media Stats for Audio
79+
// Obtain the incoming media statistics for audio
8180
List<IncomingAudioMediaStats> incomingAudioMediaStats = incomingMediaStatsInfo.getAudio();
8281

83-
// Obtain the Incoming Media Stats for Video
82+
// Obtain the incoming media statistics for video
8483
List<IncomingVideoMediaStats> incomingVideoMediaStats = incomingMediaStatsInfo.getVideo();
8584

86-
// Obtain the Incoming Media Stats for Screen Share
85+
// Obtain the incoming media statistics for screen share
8786
List<IncomingScreenShareMediaStats> incomingScreenShareMediaStats = incomingMediaStatsInfo.getScreenShare();
8887
}
8988
}
9089
```
9190

92-
[!INCLUDE [native matrics](media-stats-native-metrics.md)]
91+
[!INCLUDE [native metrics](media-stats-native-metrics.md)]
Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Azure Communication Services Media Stats (iOS)
2+
title: Azure Communication Services media quality statistics (iOS)
33
titleSuffix: An Azure Communication Services concept document
4-
description: Provides usage samples of the Media Stats feature iOS Native.
4+
description: Get usage samples of the media quality statistics feature for iOS native.
55
author: jsaurezle-msft
66
ms.author: jsaurezlee
77

@@ -12,35 +12,34 @@ ms.service: azure-communication-services
1212
ms.subservice: calling
1313
---
1414

15-
## Media quality statistics for ongoing call
15+
## Media quality statistics for an ongoing call
1616

17-
[!INCLUDE [public-preview-notes](../../../../includes/public-preview-include.md)]
18-
19-
Media quality statistics is an extended feature of the core `Call` API. You first need to obtain the MediaStats feature API object:
17+
Media quality statistics is an extended feature of the core `Call` API. You first need to obtain the `mediaStatsCallFeature` API object:
2018

2119
```swift
2220
var mediaStatsCallFeature = self.call?.feature(Features.mediaStats)
2321
```
2422

25-
The Media Stats feature object have the following API structure:
26-
- `didReceiveSample`: Delegate method for listening for periodic reports of the Media Stats.
27-
- `sampleIntervalInSeconds`: Gets and sets the interval in seconds of the Media Stats report generation. If not specified, sdk use defaults.
28-
- A `MediaStatsReport` object that contains the definition of the Outgoing and Incoming Media Stats categorized by Audio, Video and Screen Share.
29-
- `OutgoingMediaStats`: The list of Media Stats for Outgoing media.
30-
- `audio`: The list of Media Stats for the Outgoing Audio.
31-
- `video`: The list of Media Stats for the Outgoing Video.
32-
- `screenShare`: The list of Media Stats for the Outgoing Screen Share.
33-
- `OncomingStats`: The list of Media Stats for Incoming media.
34-
- `audio`: The list of Media Stats for the Incoming Audio.
35-
- `video`: The list of Media Stats for the Incoming Video.
36-
- `screenShare`: The list of Media Stats for the Incoming Screen Share.
23+
The `mediaStatsCallFeature` object has the following API structure:
24+
25+
- The `didReceiveSample` delegate method listens for periodic reports of the media statistics.
26+
- `sampleIntervalInSeconds` gets and sets the interval, in seconds, of the media statistics report generation. If it's not specified, the SDK uses defaults.
27+
- A `MediaStatsReport` object contains the definition of the outgoing and incoming media statistics, categorized by audio, video, and screen share.
28+
- `OutgoingMediaStats`: The list of media statistics for outgoing media.
29+
- `audio`: The list of media statistics for the outgoing audio.
30+
- `video`: The list of media statistics for the outgoing video.
31+
- `screenShare`: The list of media statistics for the outgoing screen share.
32+
- `OncomingStats`: The list of media statistics for incoming media.
33+
- `audio`: The list of media statistics for the incoming audio.
34+
- `video`: The list of media statistics for the incoming video.
35+
- `screenShare`: The list of media statistics for the incoming screen share.
3736
- `generatedAt`: The date when the report was generated.
38-
- `incomingMediaStats`: Gets the `IncomingMediaStats` for a `RemoteParticipant`.
37+
- `incomingMediaStats`: Gets the `IncomingMediaStats` value for `RemoteParticipant`.
3938

4039
Then, subscribe to the `SampleReported` event to get regular updates about the current media quality statistics:
4140

4241
```swift
43-
// Optional, set the interval for Media Stats report generation
42+
// Optionally, set the interval for media statistics report generation
4443
mediaStatsCallFeature.sampleIntervalInSeconds = 15
4544
mediaStatsCallFeature.delegate = MediaStatsDelegate()
4645

@@ -50,29 +49,29 @@ public class MediaStatsDelegate : MediaStatsCallFeatureDelegate
5049
public func mediaStatsCallFeature(_ mediaStatsCallFeature: MediaStatsCallFeature, didReceiveSample args: MediaStatsReportEventArgs) {
5150
let report = args.report
5251

53-
// Obtain the Outgoing Media Stats for Audio
52+
// Obtain the outgoing media statistics for audio
5453
let outgoingAudioMediaStats = report.outgoingMediaStats.audio
5554

56-
// Obtain the Outgoing Media Stats for Video
55+
// Obtain the outgoing media statistics for video
5756
let outgoingVideoMediaStats = report.outgoingMediaStats.video
5857

59-
// Obtain the Outgoing Media Stats for Screen Share
58+
// Obtain the outgoing media statistics for screen share
6059
let outgoingScreenShareMediaStats = report.outgoingMediaStats.screenShare
6160

62-
// Obtain the Incoming Media Stats for Audio
61+
// Obtain the incoming media statistics for audio
6362
let incomingAudioMediaStats = report.incomingMediaStats.audio
6463

65-
// Obtain the Incoming Media Stats for Video
64+
// Obtain the incoming media statistics for video
6665
let incomingVideoMediaStats = report.incomingMediaStats.video
6766

68-
// Obtain the Incoming Media Stats for Screen Share
67+
// Obtain the incoming media statistics for screen share
6968
let incomingScreenShareMediaStats = report.incomingMediaStats.screenShare
7069
}
7170
}
7271
```
7372

74-
Also, `MediaStatsReport` have a helper method to obtain the `IncomingMediaStats` for a particular `RemoteParticipant`.
75-
For example, in order to get the `IncomingMediaStats` for all the `RemoteParticipants` in the call you can:
73+
Also, `MediaStatsReport` has a helper method to obtain the `IncomingMediaStats` value for a particular `RemoteParticipant` instance.
74+
For example, to get the `IncomingMediaStats` value for all the remote participants in the call, you can use:
7675

7776
```swift
7877
public class MediaStatsDelegate : MediaStatsCallFeatureDelegate
@@ -83,17 +82,17 @@ public class MediaStatsDelegate : MediaStatsCallFeatureDelegate
8382
call.remoteParticipants.forEach{ remoteParticipant in
8483
let remoteIncomingMediaStats = report.incomingMediaStats(fromParticipant: remoteParticipant.identifier)
8584

86-
// Obtain the Incoming Media Stats for Audio
85+
// Obtain the incoming media statistics for audio
8786
let incomingAudioMediaStats = remoteIncomingMediaStats.audio
8887

89-
// Obtain the Incoming Media Stats for Video
88+
// Obtain the incoming media statistics for video
9089
let incomingVideoMediaStats = remoteIncomingMediaStats.video
9190

92-
// Obtain the Incoming Media Stats for Screen Share
91+
// Obtain the incoming media statistics for screen share
9392
let incomingScreenShareMediaStats = remoteIncomingMediaStats.screenShare
9493
}
9594
}
9695
}
9796
```
9897

99-
[!INCLUDE [native matrics](media-stats-native-metrics.md)]
98+
[!INCLUDE [native metrics](media-stats-native-metrics.md)]

0 commit comments

Comments
 (0)